1 -- Copyright © 2021 Damyan Ivanov.
2 -- This file is part of MoLe.
3 -- MoLe is free software: you can distribute it and/or modify it
4 -- under the term of the GNU General Public License as published by
5 -- the Free Software Foundation, either version 3 of the License, or
6 -- (at your opinion), any later version.
8 -- MoLe is distributed in the hope that it will be useful,
9 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
10 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 -- GNU General Public License terms for details.
13 -- You should have received a copy of the GNU General Public License
14 -- along with MoLe. If not, see <https://www.gnu.org/licenses/>.
16 -- migrate from revision 62 to revision 63
18 -- pragmas need to be outside of transaction control
19 -- foreign_keys is needed so that foreign key constraints are redirected
22 pragma foreign_keys = off;
26 CREATE TABLE new_templates (
27 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
30 regular_expression TEXT NOT NULL,
32 transaction_description TEXT,
33 transaction_description_match_group INTEGER,
34 transaction_comment TEXT,
35 transaction_comment_match_group INTEGER,
37 date_year_match_group INTEGER,
39 date_month_match_group INTEGER,
41 date_day_match_group INTEGER,
42 is_fallback INTEGER NOT NULL DEFAULT 0);
44 insert into new_templates(id, name, uuid, regular_expression, test_text,
45 transaction_description, transaction_description_match_group,
46 transaction_comment, transaction_comment_match_group,
47 date_year, date_year_match_group,
48 date_month, date_month_match_group,
49 date_day, date_day_match_group,
51 select id, name, random(), regular_expression, test_text,
52 transaction_description, transaction_description_match_group,
53 transaction_comment, transaction_comment_match_group,
54 date_year, date_year_match_group,
55 date_month, date_month_match_group,
56 date_day, date_day_match_group,
61 alter table new_templates rename to templates;
63 create unique index templates_uuid_idx on templates(uuid);