Skip to content

Commit

Permalink
Fix Migration_45_46
Browse files Browse the repository at this point in the history
  • Loading branch information
omurovch committed Aug 18, 2022
1 parent 6e8ac06 commit 2e161ed
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object Migration_45_46 : Migration(45, 46) {

database.execSQL("ALTER TABLE EnabledWallet RENAME TO TempEnabledWallet")
database.execSQL("CREATE TABLE IF NOT EXISTS `EnabledWallet` (`tokenQueryId` TEXT NOT NULL, `coinSettingsId` TEXT NOT NULL, `accountId` TEXT NOT NULL, `walletOrder` INTEGER, `coinName` TEXT, `coinCode` TEXT, `coinDecimals` INTEGER, PRIMARY KEY(`tokenQueryId`, `coinSettingsId`, `accountId`), FOREIGN KEY(`accountId`) REFERENCES `AccountRecord`(`id`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)")
database.execSQL("INSERT INTO EnabledWallet (`tokenQueryId`, `coinSettingsId`, `accountId`, `walletOrder`) SELECT `coinId`,`coinSettingsId`,`accountId`,`walletOrder` FROM TempEnabledWallet")
database.execSQL("INSERT INTO EnabledWallet (`tokenQueryId`, `coinSettingsId`, `accountId`, `walletOrder`, `coinName`, `coinCode`, `coinDecimals`) SELECT `coinId`,`coinSettingsId`,`accountId`,`walletOrder`,`coinName`,`coinCode`,`coinDecimals` FROM TempEnabledWallet")
database.execSQL("DROP TABLE IF EXISTS TempEnabledWallet")
database.execSQL("CREATE INDEX IF NOT EXISTS `index_EnabledWallet_accountId` ON `EnabledWallet` (`accountId`)")
}
Expand Down

0 comments on commit 2e161ed

Please sign in to comment.