summaryrefslogtreecommitdiffstats
path: root/res/raw
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-05-03 12:42:18 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-05-09 12:59:04 -0700
commit05f30889d6ba0f803c720813067b28c9c4cf2bfd (patch)
tree9e517f1ccd46bf7400172ed1f6f6026c75fbef85 /res/raw
parent07557e81a5a2dab455e724345095e2b4a32b7d17 (diff)
downloadandroid_packages_apps_Trebuchet-05f30889d6ba0f803c720813067b28c9c4cf2bfd.tar.gz
android_packages_apps_Trebuchet-05f30889d6ba0f803c720813067b28c9c4cf2bfd.tar.bz2
android_packages_apps_Trebuchet-05f30889d6ba0f803c720813067b28c9c4cf2bfd.zip
Adding support for DB downgrade
Adding a schema file for handling DB downgrade. This schema file is part of the backup/restore set, and hence is available on a device with lower app version. Bug: 37257575 Change-Id: I69c8ef5f28d5209be6e6679412c7459d4eeda5d0
Diffstat (limited to 'res/raw')
-rw-r--r--res/raw/downgrade_schema.json20
1 files changed, 20 insertions, 0 deletions
diff --git a/res/raw/downgrade_schema.json b/res/raw/downgrade_schema.json
new file mode 100644
index 000000000..3c1b64f92
--- /dev/null
+++ b/res/raw/downgrade_schema.json
@@ -0,0 +1,20 @@
+{
+ // Note: Comments are not supported in JSON schema, but android parser is lenient.
+
+ // Maximum DB version supported by this schema
+ "version" : 27,
+
+ // Downgrade from 27 to 26. Empty array indicates, the DB is compatible
+ "downgrade_to_26" : [],
+ "downgrade_to_25" : [],
+ "downgrade_to_24" : [],
+ "downgrade_to_23" : [],
+ "downgrade_to_22" : [
+ "ALTER TABLE favorites RENAME TO temp_favorites;",
+ "CREATE TABLE favorites(_id INTEGER PRIMARY KEY, title TEXT, intent TEXT, container INTEGER, screen INTEGER, cellX INTEGER, cellY INTEGER, spanX INTEGER, spanY INTEGER, itemType INTEGER, appWidgetId INTEGER NOT NULL DEFAULT - 1, iconPackage TEXT, iconResource TEXT, icon BLOB, appWidgetProvider TEXT, modified INTEGER NOT NULL DEFAULT 0, restored INTEGER NOT NULL DEFAULT 0, profileId INTEGER DEFAULT 0, rank INTEGER NOT NULL DEFAULT 0);",
+ "INSERT INTO favorites SELECT _id, title, intent, container, screen, cellX, cellY, spanX, spanY, itemType, appWidgetId, iconPackage, iconResource, icon, appWidgetProvider, modified, restored, profileId, rank FROM temp_favorites;",
+ "DROP TABLE temp_favorites;"
+ ]
+
+ // Missing values indicate the DB is not compatible
+} \ No newline at end of file