beacon/migrations/20250206105906_initial.sql

11 lines
354 B
SQL

-- Add migration script here
CREATE TABLE accounts (account_id VARCHAR(10) PRIMARY KEY);
CREATE TABLE caught_fish (
id INTEGER PRIMARY KEY,
account_id VARCHAR(10),
fish_id INTEGER,
FOREIGN KEY (account_id) REFERENCES accounts (account_id) ON DELETE CASCADE ON UPDATE NO ACTION
);
CREATE INDEX fish_accounts ON caught_fish (account_id);