-- Schema: spider__cinema
CREATE SCHEMA IF NOT EXISTS "spider__cinema";

-- Table: cinema
CREATE TABLE "spider__cinema"."cinema" (
    "Cinema_ID" BIGINT NOT NULL,
    "Name" TEXT,
    "Openning_year" BIGINT,
    "Capacity" BIGINT,
    "Location" TEXT,
    CONSTRAINT "cinema_pkey" PRIMARY KEY ("Cinema_ID")
);

-- Table: film
CREATE TABLE "spider__cinema"."film" (
    "Film_ID" BIGINT NOT NULL,
    "Rank_in_series" BIGINT,
    "Number_in_season" BIGINT,
    "Title" TEXT,
    "Directed_by" TEXT,
    "Original_air_date" TEXT,
    "Production_code" TEXT,
    CONSTRAINT "film_pkey" PRIMARY KEY ("Film_ID")
);

-- Table: schedule
CREATE TABLE "spider__cinema"."schedule" (
    "Cinema_ID" BIGINT NOT NULL,
    "Film_ID" BIGINT NOT NULL,
    "Date" TEXT,
    "Show_times_per_day" BIGINT,
    "Price" DOUBLE PRECISION,
    CONSTRAINT "schedule_pkey" PRIMARY KEY ("Cinema_ID", "Film_ID")
);

-- Foreign Keys
ALTER TABLE "spider__cinema"."schedule" ADD CONSTRAINT "fk_schedule_0" FOREIGN KEY ("Cinema_ID") REFERENCES "spider__cinema"."cinema" ("Cinema_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE "spider__cinema"."schedule" ADD CONSTRAINT "fk_schedule_1" FOREIGN KEY ("Film_ID") REFERENCES "spider__cinema"."film" ("Film_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
