fix: remove the unique constraint for patch bundle names

This commit is contained in:
Ax333l 2024-08-12 22:42:51 +02:00
parent e869db0555
commit e992a99783
No known key found for this signature in database
GPG key ID: D2B4D85271127D23
2 changed files with 5 additions and 15 deletions

View file

@ -2,7 +2,7 @@
"formatVersion": 1, "formatVersion": 1,
"database": { "database": {
"version": 1, "version": 1,
"identityHash": "c0c780e55e10c9b095c004733c846b67", "identityHash": "1dd9d5c0201fdf3cfef3ae669fd65e46",
"entities": [ "entities": [
{ {
"tableName": "patch_bundles", "tableName": "patch_bundles",
@ -51,17 +51,7 @@
"uid" "uid"
] ]
}, },
"indices": [ "indices": [],
{
"name": "index_patch_bundles_name",
"unique": true,
"columnNames": [
"name"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_patch_bundles_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [] "foreignKeys": []
}, },
{ {
@ -407,7 +397,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, 'c0c780e55e10c9b095c004733c846b67')" "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '1dd9d5c0201fdf3cfef3ae669fd65e46')"
] ]
} }
} }

View file

@ -21,7 +21,7 @@ sealed class Source {
} }
companion object { companion object {
fun from(value: String) = when(value) { fun from(value: String) = when (value) {
Local.SENTINEL -> Local Local.SENTINEL -> Local
API.SENTINEL -> API API.SENTINEL -> API
else -> Remote(Url(value)) else -> Remote(Url(value))
@ -34,7 +34,7 @@ data class VersionInfo(
@ColumnInfo(name = "integrations_version") val integrations: String? = null, @ColumnInfo(name = "integrations_version") val integrations: String? = null,
) )
@Entity(tableName = "patch_bundles", indices = [Index(value = ["name"], unique = true)]) @Entity(tableName = "patch_bundles")
data class PatchBundleEntity( data class PatchBundleEntity(
@PrimaryKey val uid: Int, @PrimaryKey val uid: Int,
@ColumnInfo(name = "name") val name: String, @ColumnInfo(name = "name") val name: String,