]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/raw/sql_54.sql
let SQL revision files control the transaction
[mobile-ledger.git] / app / src / main / res / raw / sql_54.sql
index df6b44fcd01f3ef46ecc47ab538aa1d30ae42330..f8e13ba9885127dc9f28b2330cec2a2f5904f36d 100644 (file)
@@ -15,6 +15,8 @@
 
 -- copied from the Room migration
 
+BEGIN TRANSACTION;
+
 CREATE TABLE templates (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name TEXT NOT NULL, regular_expression TEXT NOT NULL, test_text TEXT, transaction_description TEXT, transaction_description_match_group INTEGER, transaction_comment TEXT, transaction_comment_match_group INTEGER, date_year INTEGER, date_year_match_group INTEGER, date_month INTEGER, date_month_match_group INTEGER, date_day INTEGER, date_day_match_group INTEGER);
 CREATE TABLE template_accounts (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, template_id INTEGER NOT NULL, acc TEXT, position INTEGER NOT NULL, acc_match_group INTEGER, currency INTEGER, currency_match_group INTEGER, amount REAL, amount_match_group INTEGER, comment TEXT, comment_match_group INTEGER, negate_amount INTEGER, FOREIGN KEY(template_id) REFERENCES templates(id) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(currency) REFERENCES currencies(id) ON UPDATE NO ACTION ON DELETE NO ACTION);
 insert into templates(id, name, regular_expression, test_text, transaction_description, transaction_description_match_group, transaction_comment, transaction_comment_match_group, date_year, date_year_match_group, date_month, date_month_match_group, date_day, date_day_match_group) select id, name, regular_expression, test_text, transaction_description, transaction_description_match_group, transaction_comment, transaction_comment_match_group, date_year, date_year_match_group, date_month, date_month_match_group, date_day, date_day_match_group from patterns;
@@ -23,3 +25,5 @@ create index fk_template_accounts_template on template_accounts(template_id);
 create index fk_template_accounts_currency on template_accounts(currency);
 drop table pattern_accounts;
 drop table patterns;
+
+COMMIT TRANSACTION;
\ No newline at end of file