Files
budget-database/postgres/tables/accounts.sql
2023-03-04 21:10:46 -05:00

26 lines
758 B
SQL

drop table if exists public.accounts cascade;
CREATE TABLE public.accounts(
acct_id serial,
bank_name varchar(50) not null,
account_type varchar(50) not null,
account_number varchar(20) null,
friendly_name varchar(50) null,
insert_dt_tm timestamp null default now(),
PRIMARY KEY( acct_id )
);
-- Permissions
ALTER TABLE public.accounts OWNER TO acedanger;
GRANT ALL ON TABLE public.accounts TO acedanger;
GRANT ALL ON TABLE public.accounts TO budgetuser;
-- Populate table
truncate public.accounts;
INSERT INTO public.accounts (bank_name, account_type, friendly_name, account_number) values
('Bank of America', 'Checking', 'Joint Checking', '4581')
, ('Ally', 'Savings', 'Joint Savings', '9969')
, ('Ally', 'Savings', 'Vacation Savings', '6268')