downgrade_schema.json 1.5 KB

123456789101112131415161718192021222324
  1. {
  2. // Note: Comments are not supported in JSON schema, but android parser is lenient.
  3. // Maximum DB version supported by this schema
  4. "version" : 28,
  5. "downgrade_to_27" : [
  6. "CREATE TABLE workspaceScreens (_id INTEGER PRIMARY KEY,screenRank INTEGER,modified INTEGER NOT NULL DEFAULT 0)",
  7. "insert into workspaceScreens (_id, screenRank) select screen as _id, screen as screenRank from favorites where container = -100 group by screen order by screen"
  8. ],
  9. // Downgrade from 27 to 26. Empty array indicates, the DB is compatible
  10. "downgrade_to_26" : [],
  11. "downgrade_to_25" : [],
  12. "downgrade_to_24" : [],
  13. "downgrade_to_23" : [],
  14. "downgrade_to_22" : [
  15. "ALTER TABLE favorites RENAME TO temp_favorites;",
  16. "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);",
  17. "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;",
  18. "DROP TABLE temp_favorites;"
  19. ]
  20. // Missing values indicate the DB is not compatible
  21. }