movie-night-api-rust/migrations/2022-11-15-2045_create-showings/up.sql
2025-02-16 20:21:30 -06:00

17 lines
509 B
SQL

USE movienight;
CREATE TABLE IF NOT EXISTS showings
(
id INTEGER AUTO_INCREMENT PRIMARY KEY,
schedule_id INTEGER,
movie_id INTEGER,
showtime DATETIME,
public BOOL default FALSE,
owner INTEGER NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
deleted_at DATETIME,
FOREIGN KEY (movie_id) REFERENCES movies (id),
FOREIGN KEY (schedule_id) REFERENCES schedules (id),
FOREIGN KEY (owner) REFERENCES users (id)
);