Fix BitocinGtxIO Foreign Key Definition

This commit is contained in:
hvarona 2018-11-28 23:42:56 -04:00
parent a13bbadd2e
commit 2c431ef4e0
2 changed files with 3 additions and 3 deletions

View file

@ -309,7 +309,7 @@ public class GeneralAccountManager implements CryptoAccountManager, CryptoNetInf
btTransaction.setCryptoCoinTransactionId(ccId); btTransaction.setCryptoCoinTransactionId(ccId);
long btId = db.bitcoinTransactionDao().insertBitcoinTransaction(btTransaction)[0]; long btId = db.bitcoinTransactionDao().insertBitcoinTransaction(btTransaction)[0];
for (BitcoinTransactionGTxIO gtxio : gtxios) { for (BitcoinTransactionGTxIO gtxio : gtxios) {
gtxio.setBitcoinTransactionId(btId); gtxio.setBitcoinTransactionId(ccId);
db.bitcoinTransactionDao().insertBitcoinTransactionGTxIO(gtxio); db.bitcoinTransactionDao().insertBitcoinTransactionGTxIO(gtxio);
} }

View file

@ -14,8 +14,8 @@ import android.arch.persistence.room.ForeignKey;
primaryKeys = {"bitcoin_transaction_id", "io_index", "is_output"}, primaryKeys = {"bitcoin_transaction_id", "io_index", "is_output"},
foreignKeys = { foreignKeys = {
@ForeignKey( @ForeignKey(
entity = BitcoinTransaction.class, entity = CryptoCoinTransaction.class,
parentColumns = "crypto_coin_transaction_id", parentColumns = "id",
childColumns = "bitcoin_transaction_id", childColumns = "bitcoin_transaction_id",
onDelete = ForeignKey.CASCADE onDelete = ForeignKey.CASCADE
) )