accountant/src/sql/update/0.2-0.3/001_scheduled_operations.sql
Alexis Lahouze c4d7bb3f28 Removed third parties to use CloudFlare CDN.
Added scheduling (missing database update)
Using Jinja2 templates.
Updated layout.
2013-07-28 23:25:51 +02:00

17 lines
547 B
SQL

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);