]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/raw/sql_15.sql
somewhat complete profile implementation
[mobile-ledger.git] / app / src / main / res / raw / sql_15.sql
diff --git a/app/src/main/res/raw/sql_15.sql b/app/src/main/res/raw/sql_15.sql
new file mode 100644 (file)
index 0000000..56eb75e
--- /dev/null
@@ -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