]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/raw/db_64.sql
more pronounced day/month delimiters in the transaction list
[mobile-ledger.git] / app / src / main / res / raw / db_64.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 63 to revision 64
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 -- profiles
27 CREATE TABLE profiles_new (
28 id INTEGER NOT NULL PRIMARY KEY,
29 uuid TEXT NOT NULL,
30 name TEXT NOT NULL,
31 url TEXT NOT NULL,
32 use_authentication INTEGER NOT NULL,
33 auth_user TEXT,
34 auth_password TEXT,
35 order_no INTEGER NOT NULL,
36 permit_posting INTEGER NOT NULL,
37 theme INTEGER NOT NULL DEFAULT -1,
38 preferred_accounts_filter TEXT,
39 future_dates INTEGER NOT NULL,
40 api_version INTEGER NOT NULL,
41 show_commodity_by_default INTEGER NOT NULL,
42 default_commodity TEXT,
43 show_comments_by_default INTEGER NOT NULL DEFAULT 1,
44 detected_version_pre_1_19 INTEGER NOT NULL,
45 detected_version_major INTEGER NOT NULL,
46 detected_version_minor INTEGER NOT NULL);
47
48 insert into profiles_new(
49        uuid, name, url, use_authentication, auth_user, auth_password,
50        order_no, permit_posting, theme, preferred_accounts_filter, future_dates, api_version,
51        show_commodity_by_default, default_commodity, show_comments_by_default, detected_version_pre_1_19,
52        detected_version_major, detected_version_minor)
53 select coalesce(deprecated_uuid, random()), name, url, use_authentication, auth_user, auth_password,
54        order_no, permit_posting, theme, preferred_accounts_filter, future_dates, api_version,
55        show_commodity_by_default, default_commodity, show_comments_by_default, detected_version_pre_1_19,
56        detected_version_major, detected_version_minor
57 from profiles;
58
59 drop table profiles;
60 alter table profiles_new rename to profiles;
61
62 create unique index profiles_uuid_idx on profiles(uuid);