Skip to content

Instantly share code, notes, and snippets.

View Hc747's full-sized avatar
🤠
Waiting for builds to finish...

Harrison Cole Hc747

🤠
Waiting for builds to finish...
  • Australia
  • 07:38 (UTC +10:00)
View GitHub Profile
@Hc747
Hc747 / accounting.sql
Last active August 4, 2022 06:17 — forked from NYKevin/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
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...