Continued refactoring.
This commit is contained in:
18
sql/update/0.1-0.2/001_authorized_overdraft.sql
Normal file
18
sql/update/0.1-0.2/001_authorized_overdraft.sql
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
This file is part of Accountant.
|
||||
|
||||
Accountant is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Foobar is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
ALTER TABLE account ADD COLUMN authorized_overdraft INTEGER NOT NULL DEFAULT 0;
|
||||
|
26
sql/update/0.1-0.2/002_pointed.sql
Normal file
26
sql/update/0.1-0.2/002_pointed.sql
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
This file is part of Accountant.
|
||||
|
||||
Accountant is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Foobar is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
ALTER TABLE entry ADD COLUMN pointed BOOLEAN NOT NULL DEFAULT false;
|
||||
|
||||
UPDATE entry SET pointed = operation_date IS NOT NULL;
|
||||
|
||||
UPDATE entry SET operation_date = value_date;
|
||||
|
||||
ALTER TABLE entry DROP COLUMN value_date;
|
||||
|
||||
CREATE INDEX entry_operation_date_idx ON entry USING btree (operation_date);
|
||||
|
16
sql/update/0.2-0.3/000_placeholder.sql
Normal file
16
sql/update/0.2-0.3/000_placeholder.sql
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
This file is part of Accountant.
|
||||
|
||||
Accountant is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Foobar is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
16
sql/update/0.2-0.3/001_scheduled_operations.sql
Normal file
16
sql/update/0.2-0.3/001_scheduled_operations.sql
Normal file
@ -0,0 +1,16 @@
|
||||
create table scheduled_operation(
|
||||
id serial primary key,
|
||||
start_date date not null,
|
||||
stop_date date not null,
|
||||
day integer not null check (day > 0 and day <= 31),
|
||||
frequency integer not null check (frequency > 0),
|
||||
label varchar(500) not null,
|
||||
value numeric(15,2) not null,
|
||||
account_id integer not null references account(id),
|
||||
category varchar(100)
|
||||
);
|
||||
|
||||
create index scheduled_operation_account_id_idx on scheduled_operation(account_id);
|
||||
|
||||
alter table entry add column scheduled_operation_id integer references scheduled_operation(id);
|
||||
|
2
sql/update/0.2-0.3/002_operation_date_cleanup.sql
Normal file
2
sql/update/0.2-0.3/002_operation_date_cleanup.sql
Normal file
@ -0,0 +1,2 @@
|
||||
alter table entry alter column operation_date set not null;
|
||||
alter table entry drop column comment;
|
Reference in New Issue
Block a user