]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/raw/sql_55.sql
let SQL revision files control the transaction
[mobile-ledger.git] / app / src / main / res / raw / sql_55.sql
index fb77862a04f59b181af76a12a4dfc512b47dbadc..780b451ccdb2cf7673b31b0b6f49666dd243ce23 100644 (file)
@@ -14,6 +14,7 @@
 -- along with MoLe. If not, see <https://www.gnu.org/licenses/>.
 
 -- copied from the Room migration
+BEGIN TRANSACTION;
 
 CREATE TABLE template_accounts_new(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 RESTRICT ON DELETE CASCADE, FOREIGN KEY(currency) REFERENCES currencies(id) ON UPDATE RESTRICT ON DELETE RESTRICT);
 insert into template_accounts_new(id, template_id, acc, position, acc_match_group, currency, currency_match_group, amount, amount_match_group, amount, amount_match_group, comment, comment_match_group, negate_amount) select id, template_id, acc, position, acc_match_group, currency, currency_match_group, amount, amount_match_group, amount, amount_match_group, comment, comment_match_group, negate_amount from template_accounts;
@@ -22,3 +23,5 @@ alter table template_accounts_new rename to template_accounts;
 
 create index fk_template_accounts_template on template_accounts(template_id);
 create index fk_template_accounts_currency on template_accounts(currency);
+
+COMMIT TRANSACTION;
\ No newline at end of file