]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/raw/sql_58.sql
describe account_values to Room
[mobile-ledger.git] / app / src / main / res / raw / sql_58.sql
index 4c99be22a3125cebe5a51a2106a2a35f32c67bb2..23f6502a232db82a4a323cc78adc323eaf69a040 100644 (file)
@@ -50,6 +50,38 @@ select uuid, name, url, use_authentication, auth_user, auth_password, order_no,
  detected_version_pre_1_19, detected_version_major, detected_version_minor
 from profiles;
 
+drop table profiles;
+
+alter table profiles_new
+rename to profiles;
+
+create table options_new(profile varchar not null, name varchar not null, value varchar, primary key(profile, name));
+
+insert into options_new(profile, name, value)
+select profile, name, value from options;
+
+drop table options;
+
+alter table options_new
+rename to options;
+
+create table account_values_new(
+ profile varchar not null,
+ account varchar not null,
+ currency varchar not null default '',
+ value real not null,
+ generation integer not null default 0,
+ primary key(profile, account, currency));
+
+insert into account_values_new(
+ profile, account, currency, value, generation)
+select profile, account, currency, value, generation
+from account_values;
+
+drop table account_values;
+alter table account_values_new rename to account_values;
+
+
 COMMIT TRANSACTION;
 
 PRAGMA foreign_keys = ON;
\ No newline at end of file