]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/raw/db_63.sql
more pronounced day/month delimiters in the transaction list
[mobile-ledger.git] / app / src / main / res / raw / db_63.sql
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.
7 --
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.
12 --
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/>.
15
16 -- migrate from revision 62 to revision 63
17
18 -- pragmas need to be outside of transaction control
19 -- foreign_keys is needed so that foreign key constraints are redirected
20
21 commit transaction;
22 pragma foreign_keys = off;
23
24 begin transaction;
25
26 CREATE TABLE new_templates (
27     id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
28     name TEXT NOT NULL,
29     uuid TEXT NOT NULL,
30     regular_expression TEXT NOT NULL,
31     test_text TEXT,
32     transaction_description TEXT,
33     transaction_description_match_group INTEGER,
34     transaction_comment TEXT,
35     transaction_comment_match_group INTEGER,
36     date_year INTEGER,
37     date_year_match_group INTEGER,
38     date_month INTEGER,
39     date_month_match_group INTEGER,
40     date_day INTEGER,
41     date_day_match_group INTEGER,
42     is_fallback INTEGER NOT NULL DEFAULT 0);
43
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,
50     is_fallback)
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,
57        is_fallback
58 from templates;
59
60 drop table templates;
61 alter table new_templates rename to templates;
62
63 create unique index templates_uuid_idx on templates(uuid);