move to postgres; implement marking caught fish
This commit is contained in:
parent
3e249e0a0d
commit
e564e87c94
7 changed files with 110 additions and 34 deletions
|
@ -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
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue