]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/raw/sql_0.sql
move DB structure initialization in a sql_0.sql script
[mobile-ledger.git] / app / src / main / res / raw / sql_0.sql
diff --git a/app/src/main/res/raw/sql_0.sql b/app/src/main/res/raw/sql_0.sql
new file mode 100644 (file)
index 0000000..3d05c51
--- /dev/null
@@ -0,0 +1,7 @@
+create table if not exists accounts(name varchar);
+create index if not exists idx_accounts_name on accounts(name);
+create table if not exists options(name varchar, value varchar);
+create unique index if not exists idx_options_name on options(name);
+create table if not exists account_values(account varchar not null, currency varchar not null, value decimal(18,2) not null);
+create index if not exists idx_account_values_account on account_values(account);
+create unique index if not exists un_account_values on account_values(account,currency);