move to postgres; implement marking caught fish

This commit is contained in:
insects 2025-02-06 14:25:51 +01:00
parent 3e249e0a0d
commit e564e87c94
7 changed files with 110 additions and 34 deletions

View file

@ -1,10 +1,12 @@
-- Add migration script here
CREATE TABLE accounts (account_id VARCHAR(10) PRIMARY KEY);
CREATE TABLE accounts (
account_id VARCHAR(10) PRIMARY KEY NOT NULL UNIQUE
);
CREATE TABLE caught_fish (
id INTEGER PRIMARY KEY,
account_id VARCHAR(10),
fish_id INTEGER,
id SERIAL PRIMARY KEY,
account_id VARCHAR(10) NOT NULL,
fish_id INTEGER NOT NULL,
FOREIGN KEY (account_id) REFERENCES accounts (account_id) ON DELETE CASCADE ON UPDATE NO ACTION
);