From 2c431ef4e0173d6aecfed7a5e33f54bbe2382ce8 Mon Sep 17 00:00:00 2001 From: hvarona Date: Wed, 28 Nov 2018 23:42:56 -0400 Subject: [PATCH] Fix BitocinGtxIO Foreign Key Definition --- .../agorise/crystalwallet/manager/GeneralAccountManager.java | 2 +- .../agorise/crystalwallet/models/BitcoinTransactionGTxIO.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java index 42caaf7..716c3a2 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/GeneralAccountManager.java @@ -309,7 +309,7 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf btTransaction.setCryptoCoinTransactionId(ccId); long btId = db.bitcoinTransactionDao().insertBitcoinTransaction(btTransaction)[0]; for (BitcoinTransactionGTxIO gtxio : gtxios) { - gtxio.setBitcoinTransactionId(btId); + gtxio.setBitcoinTransactionId(ccId); db.bitcoinTransactionDao().insertBitcoinTransactionGTxIO(gtxio); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinTransactionGTxIO.java b/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinTransactionGTxIO.java index 105f8de..1431414 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinTransactionGTxIO.java +++ b/app/src/main/java/cy/agorise/crystalwallet/models/BitcoinTransactionGTxIO.java @@ -14,8 +14,8 @@ import android.arch.persistence.room.ForeignKey; primaryKeys = {"bitcoin_transaction_id", "io_index", "is_output"}, foreignKeys = { @ForeignKey( - entity = BitcoinTransaction.class, - parentColumns = "crypto_coin_transaction_id", + entity = CryptoCoinTransaction.class, + parentColumns = "id", childColumns = "bitcoin_transaction_id", onDelete = ForeignKey.CASCADE )