From cea9e8faeb767475f94038c124eaadc49e73a10c Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Mon, 18 Jun 2018 21:04:00 -0500 Subject: [PATCH] Set room database's exportSchema to false to avoid the generation of unnecessary json files on the migration to each new database version --- app/build.gradle | 5 - .../3.json | 704 ------------------ .../crystalwallet/dao/CrystalDatabase.java | 2 +- 3 files changed, 1 insertion(+), 710 deletions(-) delete mode 100644 app/schemas/cy.agorise.crystalwallet.dao.CrystalDatabase/3.json diff --git a/app/build.gradle b/app/build.gradle index 3e90b3c..3715f33 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,11 +9,6 @@ android { versionCode 2 versionName "0.2t.alpha" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - javaCompileOptions { - annotationProcessorOptions { - arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] - } - } vectorDrawables { useSupportLibrary true } diff --git a/app/schemas/cy.agorise.crystalwallet.dao.CrystalDatabase/3.json b/app/schemas/cy.agorise.crystalwallet.dao.CrystalDatabase/3.json deleted file mode 100644 index 06d211c..0000000 --- a/app/schemas/cy.agorise.crystalwallet.dao.CrystalDatabase/3.json +++ /dev/null @@ -1,704 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 3, - "identityHash": "5aa4eae5c7cf7e77a2ebc1d7a9dc7070", - "entities": [ - { - "tableName": "account_seed", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `master_seed` TEXT, `type` TEXT)", - "fields": [ - { - "fieldPath": "mId", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mName", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "mMasterSeed", - "columnName": "master_seed", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "type", - "columnName": "type", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [], - "foreignKeys": [] - }, - { - "tableName": "crypto_net_account", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `seed_id` INTEGER NOT NULL, `account_index` INTEGER NOT NULL, `crypto_net` TEXT, `name` TEXT, FOREIGN KEY(`seed_id`) REFERENCES `account_seed`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "mId", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mSeedId", - "columnName": "seed_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mAccountIndex", - "columnName": "account_index", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mCryptoNet", - "columnName": "crypto_net", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "mName", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_crypto_net_account_id", - "unique": false, - "columnNames": [ - "id" - ], - "createSql": "CREATE INDEX `index_crypto_net_account_id` ON `${TABLE_NAME}` (`id`)" - }, - { - "name": "index_crypto_net_account_seed_id", - "unique": false, - "columnNames": [ - "seed_id" - ], - "createSql": "CREATE INDEX `index_crypto_net_account_seed_id` ON `${TABLE_NAME}` (`seed_id`)" - }, - { - "name": "index_crypto_net_account_seed_id_crypto_net_account_index", - "unique": true, - "columnNames": [ - "seed_id", - "crypto_net", - "account_index" - ], - "createSql": "CREATE UNIQUE INDEX `index_crypto_net_account_seed_id_crypto_net_account_index` ON `${TABLE_NAME}` (`seed_id`, `crypto_net`, `account_index`)" - } - ], - "foreignKeys": [ - { - "table": "account_seed", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "seed_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "crypto_coin_transaction", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` INTEGER, `is_input` INTEGER NOT NULL, `account_id` INTEGER NOT NULL, `amount` INTEGER NOT NULL, `id_currency` INTEGER NOT NULL, `is_confirmed` INTEGER NOT NULL, `from` TEXT, `to` TEXT, FOREIGN KEY(`account_id`) REFERENCES `crypto_net_account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`id_currency`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "date", - "columnName": "date", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "isInput", - "columnName": "is_input", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "accountId", - "columnName": "account_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "amount", - "columnName": "amount", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "idCurrency", - "columnName": "id_currency", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "isConfirmed", - "columnName": "is_confirmed", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "from", - "columnName": "from", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "to", - "columnName": "to", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_crypto_coin_transaction_account_id", - "unique": false, - "columnNames": [ - "account_id" - ], - "createSql": "CREATE INDEX `index_crypto_coin_transaction_account_id` ON `${TABLE_NAME}` (`account_id`)" - }, - { - "name": "index_crypto_coin_transaction_id_currency", - "unique": false, - "columnNames": [ - "id_currency" - ], - "createSql": "CREATE INDEX `index_crypto_coin_transaction_id_currency` ON `${TABLE_NAME}` (`id_currency`)" - } - ], - "foreignKeys": [ - { - "table": "crypto_net_account", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "account_id" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "crypto_currency", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "id_currency" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "contact", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `email` TEXT, `gravatar` TEXT)", - "fields": [ - { - "fieldPath": "mId", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mName", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "mEmail", - "columnName": "email", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "mGravatar", - "columnName": "gravatar", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_contact_id", - "unique": false, - "columnNames": [ - "id" - ], - "createSql": "CREATE INDEX `index_contact_id` ON `${TABLE_NAME}` (`id`)" - }, - { - "name": "index_contact_name", - "unique": true, - "columnNames": [ - "name" - ], - "createSql": "CREATE UNIQUE INDEX `index_contact_name` ON `${TABLE_NAME}` (`name`)" - }, - { - "name": "index_contact_email", - "unique": false, - "columnNames": [ - "email" - ], - "createSql": "CREATE INDEX `index_contact_email` ON `${TABLE_NAME}` (`email`)" - } - ], - "foreignKeys": [] - }, - { - "tableName": "contact_address", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `contact_id` INTEGER NOT NULL, `crypto_net` TEXT NOT NULL, `address` TEXT)", - "fields": [ - { - "fieldPath": "mId", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mContactId", - "columnName": "contact_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mCryptoNet", - "columnName": "crypto_net", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "mAddress", - "columnName": "address", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_contact_address_id", - "unique": true, - "columnNames": [ - "id" - ], - "createSql": "CREATE UNIQUE INDEX `index_contact_address_id` ON `${TABLE_NAME}` (`id`)" - }, - { - "name": "index_contact_address_contact_id_crypto_net", - "unique": true, - "columnNames": [ - "contact_id", - "crypto_net" - ], - "createSql": "CREATE UNIQUE INDEX `index_contact_address_contact_id_crypto_net` ON `${TABLE_NAME}` (`contact_id`, `crypto_net`)" - } - ], - "foreignKeys": [] - }, - { - "tableName": "crypto_currency", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `crypto_net` TEXT, `precision` INTEGER NOT NULL)", - "fields": [ - { - "fieldPath": "mId", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mName", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "mCryptoNet", - "columnName": "crypto_net", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "mPrecision", - "columnName": "precision", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_crypto_currency_crypto_net_name", - "unique": true, - "columnNames": [ - "crypto_net", - "name" - ], - "createSql": "CREATE UNIQUE INDEX `index_crypto_currency_crypto_net_name` ON `${TABLE_NAME}` (`crypto_net`, `name`)" - } - ], - "foreignKeys": [] - }, - { - "tableName": "crypto_coin_balance", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `account_id` INTEGER NOT NULL, `crypto_currency_id` INTEGER NOT NULL, `balance` INTEGER NOT NULL, FOREIGN KEY(`account_id`) REFERENCES `crypto_net_account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "mId", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mAccountId", - "columnName": "account_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mCryptoCurrencyId", - "columnName": "crypto_currency_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mBalance", - "columnName": "balance", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_crypto_coin_balance_id", - "unique": false, - "columnNames": [ - "id" - ], - "createSql": "CREATE INDEX `index_crypto_coin_balance_id` ON `${TABLE_NAME}` (`id`)" - }, - { - "name": "index_crypto_coin_balance_account_id", - "unique": false, - "columnNames": [ - "account_id" - ], - "createSql": "CREATE INDEX `index_crypto_coin_balance_account_id` ON `${TABLE_NAME}` (`account_id`)" - }, - { - "name": "index_crypto_coin_balance_account_id_crypto_currency_id", - "unique": true, - "columnNames": [ - "account_id", - "crypto_currency_id" - ], - "createSql": "CREATE UNIQUE INDEX `index_crypto_coin_balance_account_id_crypto_currency_id` ON `${TABLE_NAME}` (`account_id`, `crypto_currency_id`)" - } - ], - "foreignKeys": [ - { - "table": "crypto_net_account", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "account_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "graphene_account", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`crypto_net_account_id` INTEGER NOT NULL, `account_name` TEXT, `account_id` TEXT, `upgraded_to_ltm` INTEGER NOT NULL, PRIMARY KEY(`crypto_net_account_id`), FOREIGN KEY(`crypto_net_account_id`) REFERENCES `crypto_net_account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "cryptoNetAccountId", - "columnName": "crypto_net_account_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "account_name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "accountId", - "columnName": "account_id", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "upgradedToLtm", - "columnName": "upgraded_to_ltm", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "crypto_net_account_id" - ], - "autoGenerate": false - }, - "indices": [], - "foreignKeys": [ - { - "table": "crypto_net_account", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "crypto_net_account_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "bitshares_asset", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`crypto_curreny_id` INTEGER NOT NULL, `bitshares_id` TEXT, `asset_type` TEXT, PRIMARY KEY(`crypto_curreny_id`), FOREIGN KEY(`crypto_curreny_id`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "cryptoCurrencyId", - "columnName": "crypto_curreny_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "bitsharesId", - "columnName": "bitshares_id", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "assetType", - "columnName": "asset_type", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "crypto_curreny_id" - ], - "autoGenerate": false - }, - "indices": [], - "foreignKeys": [ - { - "table": "crypto_currency", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "crypto_curreny_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "crypto_currency_equivalence", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `from_crypto_currency_id` INTEGER NOT NULL, `to_crypto_currency_id` INTEGER NOT NULL, `value` INTEGER NOT NULL, `last_checked` INTEGER, FOREIGN KEY(`from_crypto_currency_id`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`to_crypto_currency_id`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "fromCurrencyId", - "columnName": "from_crypto_currency_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "toCurrencyId", - "columnName": "to_crypto_currency_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "value", - "columnName": "value", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "lastChecked", - "columnName": "last_checked", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_crypto_currency_equivalence_from_crypto_currency_id_to_crypto_currency_id", - "unique": true, - "columnNames": [ - "from_crypto_currency_id", - "to_crypto_currency_id" - ], - "createSql": "CREATE UNIQUE INDEX `index_crypto_currency_equivalence_from_crypto_currency_id_to_crypto_currency_id` ON `${TABLE_NAME}` (`from_crypto_currency_id`, `to_crypto_currency_id`)" - }, - { - "name": "index_crypto_currency_equivalence_from_crypto_currency_id", - "unique": false, - "columnNames": [ - "from_crypto_currency_id" - ], - "createSql": "CREATE INDEX `index_crypto_currency_equivalence_from_crypto_currency_id` ON `${TABLE_NAME}` (`from_crypto_currency_id`)" - }, - { - "name": "index_crypto_currency_equivalence_to_crypto_currency_id", - "unique": false, - "columnNames": [ - "to_crypto_currency_id" - ], - "createSql": "CREATE INDEX `index_crypto_currency_equivalence_to_crypto_currency_id` ON `${TABLE_NAME}` (`to_crypto_currency_id`)" - } - ], - "foreignKeys": [ - { - "table": "crypto_currency", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "from_crypto_currency_id" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "crypto_currency", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "to_crypto_currency_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "general_setting", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `value` TEXT)", - "fields": [ - { - "fieldPath": "mId", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "mName", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "mValue", - "columnName": "value", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [], - "foreignKeys": [] - } - ], - "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, \"5aa4eae5c7cf7e77a2ebc1d7a9dc7070\")" - ] - } -} \ No newline at end of file diff --git a/app/src/main/java/cy/agorise/crystalwallet/dao/CrystalDatabase.java b/app/src/main/java/cy/agorise/crystalwallet/dao/CrystalDatabase.java index 5db0c0f..cd8840a 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/dao/CrystalDatabase.java +++ b/app/src/main/java/cy/agorise/crystalwallet/dao/CrystalDatabase.java @@ -40,7 +40,7 @@ import cy.agorise.crystalwallet.models.GrapheneAccountInfo; BitsharesAccountNameCache.class, CryptoCurrencyEquivalence.class, GeneralSetting.class -}, version = 4) +}, version = 4, exportSchema = false) @TypeConverters({Converters.class}) public abstract class CrystalDatabase extends RoomDatabase {