24 lines
739 B
SQL
24 lines
739 B
SQL
CREATE TABLE IF NOT EXISTS movie (
|
|
id TEXT PRIMARY KEY,
|
|
name TEXT NOT NULL,
|
|
aka TEXT,
|
|
nationality TEXT,
|
|
age INTEGER,
|
|
shoot_location TEXT,
|
|
shoot_date TEXT,
|
|
duration_seconds INTEGER,
|
|
description TEXT,
|
|
rating REAL,
|
|
web_url TEXT,
|
|
thumbnail TEXT,
|
|
published TEXT,
|
|
updated TEXT,
|
|
|
|
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
modified_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CHECK (age IS NULL OR age >= 0),
|
|
CHECK (rating IS NULL OR rating BETWEEN 0 AND 10),
|
|
CHECK (duration_seconds IS NULL OR duration_seconds >= 0)
|
|
);
|