You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 26, 2025. It is now read-only.
@@ -47,7 +44,6 @@ abstract class AppDatabase : RoomDatabase() {
47
44
privatevarINSTANCE:AppDatabase?=null
48
45
49
46
privateconstval dbName ="com.bnyro.clock"
50
-
lateinitvar instance:AppDatabase
51
47
52
48
privatevalMIGRATION_1_2=object:Migration(1, 2) {
53
49
overridefunmigrate(db:SupportSQLiteDatabase) {
@@ -72,20 +68,8 @@ abstract class AppDatabase : RoomDatabase() {
72
68
overridefunmigrate(db:SupportSQLiteDatabase) {
73
69
db.execSQL("ALTER TABLE timeZones RENAME TO temp_table")
74
70
db.execSQL("CREATE TABLE IF NOT EXISTS `timeZones` (`zoneId` TEXT NOT NULL, `zoneName` TEXT NOT NULL, `countryName` TEXT NOT NULL, `offset` INTEGER NOT NULL, `key` TEXT NOT NULL, PRIMARY KEY(`key`))")
75
-
db.execSQL("INSERT INTO timeZones (key, zoneId, offset, zoneName, countryName) SELECT name, name, offset, displayName, countryName FROM temp_table")
71
+
db.execSQL("INSERT INTO timeZones (key, zoneId, offset, zoneName, countryName) SELECT name || ',' || displayName || ',' || countryName, name, offset, displayName, countryName FROM temp_table")
76
72
db.execSQL("DROP TABLE temp_table")
77
-
78
-
postMigrate7to8()
79
-
}
80
-
}
81
-
82
-
privatefunpostMigrate7to8() {
83
-
CoroutineScope(Dispatchers.IO).launch {
84
-
val zones = instance.timeZonesDao().getAll().map {
0 commit comments