X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;ds=sidebyside;f=app%2Fsrc%2Fmain%2Fres%2Fraw%2Fsql_15.sql;fp=app%2Fsrc%2Fmain%2Fres%2Fraw%2Fsql_15.sql;h=56eb75e2785bc8a7c5546ab71c9d6491a57ed554;hb=3b365016042215dd73cb4600840aa8199b8322b9;hp=0000000000000000000000000000000000000000;hpb=57600692e78322e04de0db7be62f595b1230b0ec;p=mobile-ledger.git diff --git a/app/src/main/res/raw/sql_15.sql b/app/src/main/res/raw/sql_15.sql new file mode 100644 index 00000000..56eb75e2 --- /dev/null +++ b/app/src/main/res/raw/sql_15.sql @@ -0,0 +1,10 @@ +delete from options where profile is null and name='last_scrape'; +create table new_options(profile varchar not null, name varchar not null, value varchar); + +insert into new_options(profile, name, value) select distinct '-', o.name, (select o2.value from options o2 where o2.name=o.name and o2.profile is null) from options o where o.profile is null; +insert into new_options(profile, name, value) select distinct o.profile, o.name, (select o2.value from options o2 where o2.name=o.name and o2.profile=o.profile) from options o where o.profile is not null; +drop table options; +create table options(profile varchar not null, name varchar not null, value varchar); +create unique index un_options on options(profile,name); +insert into options(profile,name,value) select profile,name,value from new_options; +drop table new_options; \ No newline at end of file