Files
evening_detective_server/migrations/20260725145354_crerate_links_table.sql
T
2026-07-25 22:04:07 +07:00

15 lines
440 B
SQL

-- +goose Up
CREATE TABLE
IF NOT EXISTS links (
id SERIAL PRIMARY KEY,
team_id INTEGER,
game_id INTEGER,
created_at TIMESTAMP NOT NULL DEFAULT NOW (),
CONSTRAINT fk_links_team FOREIGN KEY (team_id) REFERENCES teams (id) ON DELETE RESTRICT,
CONSTRAINT fk_links_game FOREIGN KEY (game_id) REFERENCES games (id) ON DELETE RESTRICT
);
-- +goose Down
DROP TABLE IF EXISTS links;