21 lines
726 B
SQL
21 lines
726 B
SQL
create table months (
|
|
id uuid primary key default gen_random_uuid(),
|
|
label text not null,
|
|
snapshot jsonb not null,
|
|
created_at timestamptz not null default now()
|
|
);
|
|
|
|
create table budget_entries (
|
|
id uuid primary key default gen_random_uuid(),
|
|
type text not null check (type in ('revenue', 'investments', 'mandatory', 'personal')),
|
|
label text not null,
|
|
amount numeric not null,
|
|
month_id uuid references months(id) on delete set null,
|
|
created_at timestamptz not null default now()
|
|
);
|
|
|
|
alter table budget_entries enable row level security;
|
|
alter table months enable row level security;
|
|
|
|
create policy "Allow all" on budget_entries for all using (true);
|
|
create policy "Allow all" on months for all using (true); |