From d36de0b30a8bb2d1bea38fa9abaa03797dbbbeb6 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 7 Feb 2019 10:26:09 -0600 Subject: [PATCH] Fix db migration for the transfers table and for transfers of other asset than BTS, so that its propper bts_value can be fetched later. --- .../cy/agorise/bitsybitshareswallet/database/BitsyDatabase.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/database/BitsyDatabase.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/database/BitsyDatabase.kt index fb12aa5..245da98 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/database/BitsyDatabase.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/database/BitsyDatabase.kt @@ -70,6 +70,7 @@ abstract class BitsyDatabase : RoomDatabase() { database.execSQL("ALTER TABLE transfers ADD bts_value INTEGER") database.execSQL("UPDATE transfers SET bts_value = transfer_amount WHERE transfer_asset_id = '1.3.0'") + database.execSQL("UPDATE transfers SET bts_value = -1 WHERE transfer_asset_id != '1.3.0'") database.execSQL("DROP TABLE assets") database.execSQL("CREATE TABLE IF NOT EXISTS assets (`id` TEXT NOT NULL, `symbol` TEXT NOT NULL, `precision` INTEGER NOT NULL, `description` TEXT NOT NULL, `issuer` TEXT NOT NULL, PRIMARY KEY(`id`))")