This change bumps the database version and adds a migration which reverses the ranks. Test: atest CommunalDatabaseMigrationsTest Test: verified on device migration is successful Bug: 348041107 Flag: com.android.systemui.communal_hub Change-Id: Iea88a24e2b559857e3f83b1e3c1f40ab647554eb
81 lines
2.4 KiB
JSON
81 lines
2.4 KiB
JSON
{
|
|
"formatVersion": 1,
|
|
"database": {
|
|
"version": 3,
|
|
"identityHash": "02e2da2d36e6955200edd5fb49e63c72",
|
|
"entities": [
|
|
{
|
|
"tableName": "communal_widget_table",
|
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `widget_id` INTEGER NOT NULL, `component_name` TEXT NOT NULL, `item_id` INTEGER NOT NULL, `user_serial_number` INTEGER NOT NULL DEFAULT -1)",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "uid",
|
|
"columnName": "uid",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "widgetId",
|
|
"columnName": "widget_id",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "componentName",
|
|
"columnName": "component_name",
|
|
"affinity": "TEXT",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "itemId",
|
|
"columnName": "item_id",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "userSerialNumber",
|
|
"columnName": "user_serial_number",
|
|
"affinity": "INTEGER",
|
|
"notNull": true,
|
|
"defaultValue": "-1"
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"autoGenerate": true,
|
|
"columnNames": [
|
|
"uid"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"tableName": "communal_item_rank_table",
|
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `rank` INTEGER NOT NULL DEFAULT 0)",
|
|
"fields": [
|
|
{
|
|
"fieldPath": "uid",
|
|
"columnName": "uid",
|
|
"affinity": "INTEGER",
|
|
"notNull": true
|
|
},
|
|
{
|
|
"fieldPath": "rank",
|
|
"columnName": "rank",
|
|
"affinity": "INTEGER",
|
|
"notNull": true,
|
|
"defaultValue": "0"
|
|
}
|
|
],
|
|
"primaryKey": {
|
|
"autoGenerate": true,
|
|
"columnNames": [
|
|
"uid"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"setupQueries": [
|
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '02e2da2d36e6955200edd5fb49e63c72')"
|
|
]
|
|
}
|
|
} |