This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE account_groups | |
( | |
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ), | |
name text COLLATE pg_catalog."default" NOT NULL, | |
account_group_id bigint, | |
CONSTRAINT account_types_pkey PRIMARY KEY (id), | |
CONSTRAINT account_groups_account_group_id_fkey FOREIGN KEY (account_group_id) | |
REFERENCES public.account_groups (id) MATCH SIMPLE | |
ON UPDATE NO ACTION | |
ON DELETE NO ACTION, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |