X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fdb%2FTransaction.java;h=05e63d8c0e92dd05c3db2aa48603a65159d5cd6e;hp=d67cedf53d6df0002205cbd170a886f971ace772;hb=87a1e58f79757bb0257c911e9bd77eb5d77a3e40;hpb=93545c6fbf1244fbd96ecfc50e1115dbdc25f9ae diff --git a/app/src/main/java/net/ktnx/mobileledger/db/Transaction.java b/app/src/main/java/net/ktnx/mobileledger/db/Transaction.java index d67cedf5..05e63d8c 100644 --- a/app/src/main/java/net/ktnx/mobileledger/db/Transaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/db/Transaction.java @@ -36,8 +36,8 @@ create index idx_transaction_description on transactions(description); @Entity(tableName = "transactions", foreignKeys = { @ForeignKey(entity = Profile.class, parentColumns = "id", childColumns = "profile_id", onDelete = ForeignKey.CASCADE, onUpdate = ForeignKey.RESTRICT) -}, indices = {@Index(name = "un_transactions_data_hash", unique = true, - value = {"profile_id", "data_hash"}), +}, indices = {@Index(name = "un_transactions_ledger_id", unique = true, + value = {"profile_id", "ledger_id"}), @Index(name = "idx_transaction_description", value = "description"), @Index(name = "fk_transaction_profile", value = "profile_id") }) @@ -45,6 +45,8 @@ public class Transaction { @ColumnInfo @PrimaryKey(autoGenerate = true) long id; + @ColumnInfo(name = "ledger_id") + long ledgerId; @ColumnInfo(name = "profile_id") private long profileId; @ColumnInfo(name = "data_hash") @@ -63,6 +65,12 @@ public class Transaction { private String comment; @ColumnInfo private int generation = 0; + public long getLedgerId() { + return ledgerId; + } + public void setLedgerId(long ledgerId) { + this.ledgerId = ledgerId; + } public long getProfileId() { return profileId; }