mirror of
https://github.com/acedanger/budget-database.git
synced 2025-12-06 07:00:14 -08:00
added support for multiple accounts
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
-- public.budgetdetails definition
|
||||
|
||||
-- Drop table
|
||||
DROP TABLE public.budgetdetails;
|
||||
DROP table if exists public.budgetdetails cascade;
|
||||
|
||||
CREATE TABLE public.budgetdetails (
|
||||
trxid uuid NOT NULL DEFAULT uuid_generate_v4(),
|
||||
trxdescription text NOT NULL,
|
||||
trxdate date NOT NULL,
|
||||
trxamount money NOT NULL,
|
||||
insertdttm timestamp NULL DEFAULT now(),
|
||||
CONSTRAINT budgetdetails_pkey PRIMARY KEY (trxid)
|
||||
trx_id uuid NOT NULL DEFAULT uuid_generate_v4(),
|
||||
trx_description text NOT NULL,
|
||||
trx_date date NOT NULL,
|
||||
trx_amount numeric NOT NULL,
|
||||
acct_id int NULL,
|
||||
insert_dt_tm timestamp NULL DEFAULT now(),
|
||||
primary key ( trx_id ),
|
||||
constraint fk_acct foreign key ( acct_id ) references public.accounts(acct_id) on delete set null
|
||||
);
|
||||
|
||||
-- Permissions
|
||||
|
||||
ALTER TABLE public.budgetdetails OWNER TO acedanger;
|
||||
GRANT ALL ON TABLE public.budgetdetails TO acedanger;
|
||||
GRANT ALL ON TABLE public.budgetdetails TO budgetuser;
|
||||
GRANT ALL ON TABLE public.budgetdetails TO budgetuser;
|
||||
|
||||
Reference in New Issue
Block a user