From bc4c55c442d22e34e4da3827947c7fa9a2ab4bc1 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 17 Sep 2020 07:02:00 +0000 Subject: [PATCH] fix transaction_accounts in create_db.sql columns can't come after constraints, it seems --- app/src/main/res/raw/create_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/raw/create_db.sql b/app/src/main/res/raw/create_db.sql index dc96f4bb..e640baef 100644 --- a/app/src/main/res/raw/create_db.sql +++ b/app/src/main/res/raw/create_db.sql @@ -25,7 +25,7 @@ create table transactions(profile varchar not null, id integer not null, data_ha create unique index un_transactions_id on transactions(profile,id); create unique index un_transactions_data_hash on transactions(profile,data_hash); create index idx_transaction_description on transactions(description); -create table transaction_accounts(profile varchar not null, transaction_id integer not null, order_no integer not null, account_name varchar not null, currency varchar not null default '', amount decimal not null, comment varchar, constraint fk_transaction_accounts_acc foreign key(profile,account_name) references accounts(profile,name), constraint fk_transaction_accounts_trn foreign key(profile, transaction_id) references transactions(profile,id), generation integer default 0); +create table transaction_accounts(profile varchar not null, transaction_id integer not null, order_no integer not null, account_name varchar not null, currency varchar not null default '', amount decimal not null, comment varchar, generation integer default 0, constraint fk_transaction_accounts_acc foreign key(profile,account_name) references accounts(profile,name), constraint fk_transaction_accounts_trn foreign key(profile, transaction_id) references transactions(profile,id)); create unique index un_transaction_accounts_order on transaction_accounts(profile, transaction_id, order_no); create table currencies(id integer not null primary key, name varchar not null, position varchar not null, has_gap boolean not null); -- updated to revision 39 \ No newline at end of file -- 2.39.2