This commit is contained in:
kunfei 2023-02-19 19:59:54 +08:00
parent 5b1e4b6bf6
commit ad3a1eec4d
3 changed files with 15 additions and 5 deletions

View File

@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 60,
"identityHash": "a1c0854a62819a02546c82a1d60ac1b8",
"identityHash": "19e1f66252eb41afc0990f202fe4527a",
"entities": [
{
"tableName": "books",
@ -1689,7 +1689,7 @@
},
{
"tableName": "dictRules",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `urlRule` TEXT NOT NULL, `showRule` TEXT NOT NULL, PRIMARY KEY(`name`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `urlRule` TEXT NOT NULL, `showRule` TEXT NOT NULL, `enabled` INTEGER NOT NULL, PRIMARY KEY(`name`))",
"fields": [
{
"fieldPath": "name",
@ -1708,6 +1708,12 @@
"columnName": "showRule",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "enabled",
"columnName": "enabled",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
@ -1766,7 +1772,7 @@
"views": [],
"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, 'a1c0854a62819a02546c82a1d60ac1b8')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '19e1f66252eb41afc0990f202fe4527a')"
]
}
}

View File

@ -12,6 +12,9 @@ interface DictRuleDao {
@get:Query("select * from dictRules")
val all: List<DictRule>
@get:Query("select * from dictRules where enabled = 1")
val enabled: List<DictRule>
@Upsert
fun upsert(vararg dictRule: DictRule)

View File

@ -10,6 +10,7 @@ import androidx.room.PrimaryKey
data class DictRule(
@PrimaryKey
val name: String,
val urlRule: String,
val showRule: String
var urlRule: String,
var showRule: String,
var enabled: Boolean
)