fix: crash when removing used bundles

This commit is contained in:
Ax333l 2024-07-04 13:58:55 +02:00
parent 48fe3a707e
commit a22158d070
No known key found for this signature in database
GPG key ID: D2B4D85271127D23
2 changed files with 6 additions and 5 deletions

View file

@ -2,7 +2,7 @@
"formatVersion": 1, "formatVersion": 1,
"database": { "database": {
"version": 1, "version": 1,
"identityHash": "802fa2fda94b930bf0ebb85d195f1022", "identityHash": "c0c780e55e10c9b095c004733c846b67",
"entities": [ "entities": [
{ {
"tableName": "patch_bundles", "tableName": "patch_bundles",
@ -231,7 +231,7 @@
}, },
{ {
"tableName": "applied_patch", "tableName": "applied_patch",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`package_name` TEXT NOT NULL, `bundle` INTEGER NOT NULL, `patch_name` TEXT NOT NULL, PRIMARY KEY(`package_name`, `bundle`, `patch_name`), FOREIGN KEY(`package_name`) REFERENCES `installed_app`(`current_package_name`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`bundle`) REFERENCES `patch_bundles`(`uid`) ON UPDATE NO ACTION ON DELETE NO ACTION )", "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`package_name` TEXT NOT NULL, `bundle` INTEGER NOT NULL, `patch_name` TEXT NOT NULL, PRIMARY KEY(`package_name`, `bundle`, `patch_name`), FOREIGN KEY(`package_name`) REFERENCES `installed_app`(`current_package_name`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`bundle`) REFERENCES `patch_bundles`(`uid`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [ "fields": [
{ {
"fieldPath": "packageName", "fieldPath": "packageName",
@ -285,7 +285,7 @@
}, },
{ {
"table": "patch_bundles", "table": "patch_bundles",
"onDelete": "NO ACTION", "onDelete": "CASCADE",
"onUpdate": "NO ACTION", "onUpdate": "NO ACTION",
"columns": [ "columns": [
"bundle" "bundle"
@ -407,7 +407,7 @@
"views": [], "views": [],
"setupQueries": [ "setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", "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, '802fa2fda94b930bf0ebb85d195f1022')" "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'c0c780e55e10c9b095c004733c846b67')"
] ]
} }
} }

View file

@ -22,7 +22,8 @@ import kotlinx.parcelize.Parcelize
ForeignKey( ForeignKey(
PatchBundleEntity::class, PatchBundleEntity::class,
parentColumns = ["uid"], parentColumns = ["uid"],
childColumns = ["bundle"] childColumns = ["bundle"],
onDelete = ForeignKey.CASCADE
) )
], ],
indices = [Index(value = ["bundle"], unique = false)] indices = [Index(value = ["bundle"], unique = false)]