- Fixed duplicated transactions by inserting new primary key yo crypto_coin_transaction

feat_androidx_migration
Javier Varona 2018-11-24 22:08:14 -04:00
parent b10b385a83
commit c2575c7ab8
3 changed files with 13 additions and 9 deletions

View File

@ -72,10 +72,10 @@ public abstract class CrystalDatabase extends RoomDatabase {
Room.databaseBuilder(context, Room.databaseBuilder(context,
CrystalDatabase.class, "CrystalWallet.db") CrystalDatabase.class, "CrystalWallet.db")
.allowMainThreadQueries() .allowMainThreadQueries()
.addMigrations(MIGRATION_2_3) //.addMigrations(MIGRATION_2_3)
.addMigrations(MIGRATION_3_4) //.addMigrations(MIGRATION_3_4)
.addMigrations(MIGRATION_4_5) //.addMigrations(MIGRATION_4_5)
.addMigrations(MIGRATION_5_6) //.addMigrations(MIGRATION_5_6)
.build(); .build();
} }
return instance; return instance;

View File

@ -680,14 +680,14 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
/* /*
* If exists mode scurity show it and valide events in case of success or fail * If exists mode scurity show it and valide events in case of success or fail
* */ * */
/* CrystalSecurityMonitor.getInstance(this.getActivity()).callPasswordRequest(this.getActivity(), new OnResponse() { CrystalSecurityMonitor.getInstance(this.getActivity()).callPasswordRequest(this.getActivity(), new OnResponse() {
@Override @Override
public void onSuccess() { public void onSuccess() {
/* /*
* Show loading dialog * Show loading dialog
* */ * */
/* crystalDialog = new CrystalDialog((Activity) getContext()); crystalDialog = new CrystalDialog((Activity) getContext());
crystalDialog.setText("Sending"); crystalDialog.setText("Sending");
crystalDialog.progress(); crystalDialog.progress();
crystalDialog.show(); crystalDialog.show();
@ -699,8 +699,8 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
public void onFailed() { public void onFailed() {
} }
});*/ });
CryptoNetInfoRequests.getInstance().addRequest(sendRequest); //CryptoNetInfoRequests.getInstance().addRequest(sendRequest);
} }
} }

View File

@ -20,9 +20,13 @@ import cy.agorise.crystalwallet.enums.CryptoCoin;
*/ */
@Entity( @Entity(
tableName="crypto_coin_transaction", tableName="crypto_coin_transaction",
primaryKeys = {
},
indices={ indices={
@Index(value={"account_id"}), @Index(value={"account_id"}),
@Index(value={"id_currency"}) @Index(value={"id_currency"}),
@Index(value={"date", "account_id", "id_currency", "from", "to"},unique=true)
}, },
foreignKeys = { foreignKeys = {
@ForeignKey( @ForeignKey(