You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
464 B

CREATE TABLE account (
id SERIAL PRIMARY KEY,
name VARCHAR(48) UNIQUE NOT NULL,
created TIMESTAMP NOT NULL
);
CREATE TABLE balance (
id INT NOT NULL PRIMARY KEY,
gold NUMERIC(16,2) NOT NULL,
FOREIGN KEY (id) REFERENCES account (id)
);
CREATE TABLE transaction (
id SERIAL PRIMARY KEY,
account INT NOT NULL,
amount NUMERIC(16,2) NOT NULL,
timestamp TIMESTAMP NOT NULL,
FOREIGN KEY (account) REFERENCES account (id)
);