X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fres%2Fraw%2Fsql_9.sql;fp=app%2Fsrc%2Fmain%2Fres%2Fraw%2Fsql_9.sql;h=936cec6761ec694d4dca4a817db330f536f17da3;hb=a686c3293dd0dbbe49db7fc0f287c451d6b2ecd8;hp=0000000000000000000000000000000000000000;hpb=be05b80855f5e1f7d9d69426ed2a6ddfdd6d5a60;p=mobile-ledger.git diff --git a/app/src/main/res/raw/sql_9.sql b/app/src/main/res/raw/sql_9.sql new file mode 100644 index 00000000..936cec67 --- /dev/null +++ b/app/src/main/res/raw/sql_9.sql @@ -0,0 +1,9 @@ +alter table transactions add keep boolean default 1 not null; +update transactions set keep = 1; +create table transactions_new(id integer, date varchar, description varchar, data_hash varchar, keep boolean); +insert into transactions_new(id, date, description, data_hash, keep) select cast(id as integer), date, description, data_hash, keep from transactions; +drop table transactions; +create table transactions(id integer primary key, date varchar, description varchar, data_hash varchar, keep boolean); +create unique index un_transactions_data_hash on transactions(data_hash); +insert into transactions(id, date, description, data_hash, keep) select id, date, description, data_hash, keep from transactions_new; +drop table transactions_new; \ No newline at end of file