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

-- Table: actor
CREATE TABLE "bird__movie"."actor" (
    "ActorID" BIGINT NOT NULL,
    "Name" TEXT,
    "Date of Birth" DATE,
    "Birth City" TEXT,
    "Birth Country" TEXT,
    "Height (Inches)" BIGINT,
    "Biography" TEXT,
    "Gender" TEXT,
    "Ethnicity" TEXT,
    "NetWorth" TEXT,
    CONSTRAINT "actor_pk" PRIMARY KEY ("ActorID")
);

-- Table: characters
CREATE TABLE "bird__movie"."characters" (
    "MovieID" BIGINT NOT NULL,
    "ActorID" BIGINT NOT NULL,
    "Character Name" TEXT,
    "creditOrder" BIGINT,
    "pay" TEXT,
    "screentime" TEXT,
    CONSTRAINT "characters_pkey" PRIMARY KEY ("MovieID", "ActorID")
);

-- Table: movie
CREATE TABLE "bird__movie"."movie" (
    "MovieID" BIGINT NOT NULL,
    "Title" TEXT,
    "MPAA Rating" TEXT,
    "Budget" BIGINT,
    "Gross" BIGINT,
    "Release Date" TEXT,
    "Genre" TEXT,
    "Runtime" BIGINT,
    "Rating" DOUBLE PRECISION,
    "Rating Count" BIGINT,
    "Summary" TEXT,
    CONSTRAINT "movie_pk" PRIMARY KEY ("MovieID")
);

-- Foreign Keys
ALTER TABLE "bird__movie"."characters" ADD CONSTRAINT "fk_characters_0" FOREIGN KEY ("MovieID") REFERENCES "bird__movie"."movie" ("MovieID") ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE "bird__movie"."characters" ADD CONSTRAINT "fk_characters_1" FOREIGN KEY ("ActorID") REFERENCES "bird__movie"."actor" ("ActorID") ON DELETE NO ACTION ON UPDATE NO ACTION;
