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

-- Table: PlayerInfo
CREATE TABLE "bird__ice_hockey_draft"."PlayerInfo" (
    "ELITEID" BIGINT NOT NULL,
    "PlayerName" TEXT,
    "birthdate" TEXT,
    "birthyear" DATE,
    "birthmonth" BIGINT,
    "birthday" BIGINT,
    "birthplace" TEXT,
    "nation" TEXT,
    "height" BIGINT,
    "weight" BIGINT,
    "position_info" TEXT,
    "shoots" TEXT,
    "draftyear" BIGINT,
    "draftround" BIGINT,
    "overall" BIGINT,
    "overallby" TEXT,
    "CSS_rank" BIGINT,
    "sum_7yr_GP" BIGINT,
    "sum_7yr_TOI" BIGINT,
    "GP_greater_than_0" TEXT,
    CONSTRAINT "PlayerInfo_pkey" PRIMARY KEY ("ELITEID")
);

-- Table: SeasonStatus
CREATE TABLE "bird__ice_hockey_draft"."SeasonStatus" (
    "ELITEID" BIGINT,
    "SEASON" TEXT,
    "TEAM" TEXT,
    "LEAGUE" TEXT,
    "GAMETYPE" TEXT,
    "GP" BIGINT,
    "G" BIGINT,
    "A" BIGINT,
    "P" BIGINT,
    "PIM" BIGINT,
    "PLUSMINUS" BIGINT
);

-- Table: height_info
CREATE TABLE "bird__ice_hockey_draft"."height_info" (
    "height_id" BIGINT NOT NULL,
    "height_in_cm" BIGINT,
    "height_in_inch" TEXT,
    CONSTRAINT "height_info_pkey" PRIMARY KEY ("height_id")
);

-- Table: weight_info
CREATE TABLE "bird__ice_hockey_draft"."weight_info" (
    "weight_id" BIGINT NOT NULL,
    "weight_in_kg" BIGINT,
    "weight_in_lbs" BIGINT,
    CONSTRAINT "weight_info_pkey" PRIMARY KEY ("weight_id")
);

-- Foreign Keys
ALTER TABLE "bird__ice_hockey_draft"."PlayerInfo" ADD CONSTRAINT "fk_PlayerInfo_0" FOREIGN KEY ("weight") REFERENCES "bird__ice_hockey_draft"."weight_info" ("weight_id") ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE "bird__ice_hockey_draft"."PlayerInfo" ADD CONSTRAINT "fk_PlayerInfo_1" FOREIGN KEY ("height") REFERENCES "bird__ice_hockey_draft"."height_info" ("height_id") ON DELETE NO ACTION ON UPDATE NO ACTION;
