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

-- Table: candidate
CREATE TABLE "spider__candidate_poll"."candidate" (
    "Candidate_ID" BIGINT NOT NULL,
    "People_ID" BIGINT,
    "Poll_Source" TEXT,
    "Date" TEXT,
    "Support_rate" DOUBLE PRECISION,
    "Consider_rate" DOUBLE PRECISION,
    "Oppose_rate" DOUBLE PRECISION,
    "Unsure_rate" DOUBLE PRECISION,
    CONSTRAINT "candidate_pkey" PRIMARY KEY ("Candidate_ID")
);

-- Table: people
CREATE TABLE "spider__candidate_poll"."people" (
    "People_ID" BIGINT NOT NULL,
    "Sex" TEXT,
    "Name" TEXT,
    "Date_of_Birth" TEXT,
    "Height" DOUBLE PRECISION,
    "Weight" DOUBLE PRECISION,
    CONSTRAINT "people_pkey" PRIMARY KEY ("People_ID")
);

-- Foreign Keys
ALTER TABLE "spider__candidate_poll"."candidate" ADD CONSTRAINT "fk_candidate_0" FOREIGN KEY ("People_ID") REFERENCES "spider__candidate_poll"."people" ("People_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
