Skip to content

Commit 82bb7a0

Browse files
committed
fix: migration
1 parent 07eccd8 commit 82bb7a0

File tree

2 files changed

+67
-1
lines changed
  • app
    • schemas/to.bitkit.data.AppDb
    • src/main/java/to/bitkit/data

2 files changed

+67
-1
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"formatVersion": 1,
3+
"database": {
4+
"version": 2,
5+
"identityHash": "548162ed64d13ae0bed807c23709b850",
6+
"entities": [
7+
{
8+
"tableName": "config",
9+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`walletIndex` INTEGER NOT NULL, PRIMARY KEY(`walletIndex`))",
10+
"fields": [
11+
{
12+
"fieldPath": "walletIndex",
13+
"columnName": "walletIndex",
14+
"affinity": "INTEGER",
15+
"notNull": true
16+
}
17+
],
18+
"primaryKey": {
19+
"autoGenerate": false,
20+
"columnNames": [
21+
"walletIndex"
22+
]
23+
},
24+
"indices": [],
25+
"foreignKeys": []
26+
},
27+
{
28+
"tableName": "invoice_tag",
29+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`paymentHash` TEXT NOT NULL, `tags` TEXT NOT NULL, `createdAt` INTEGER NOT NULL, PRIMARY KEY(`paymentHash`))",
30+
"fields": [
31+
{
32+
"fieldPath": "paymentHash",
33+
"columnName": "paymentHash",
34+
"affinity": "TEXT",
35+
"notNull": true
36+
},
37+
{
38+
"fieldPath": "tags",
39+
"columnName": "tags",
40+
"affinity": "TEXT",
41+
"notNull": true
42+
},
43+
{
44+
"fieldPath": "createdAt",
45+
"columnName": "createdAt",
46+
"affinity": "INTEGER",
47+
"notNull": true
48+
}
49+
],
50+
"primaryKey": {
51+
"autoGenerate": false,
52+
"columnNames": [
53+
"paymentHash"
54+
]
55+
},
56+
"indices": [],
57+
"foreignKeys": []
58+
}
59+
],
60+
"views": [],
61+
"setupQueries": [
62+
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
63+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '548162ed64d13ae0bed807c23709b850')"
64+
]
65+
}
66+
}

app/src/main/java/to/bitkit/data/AppDb.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import to.bitkit.env.Env
2727
ConfigEntity::class,
2828
InvoiceTagEntity::class
2929
],
30-
version = 1,
30+
version = 2,
3131
)
3232

3333
@TypeConverters(StringListConverter::class)

0 commit comments

Comments
 (0)