-- SEQUENCE: public.GYNCardGeneration_GYNCardGenerationId_seq

-- DROP SEQUENCE IF EXISTS public."GYNCardGeneration_GYNCardGenerationId_seq";

CREATE SEQUENCE IF NOT EXISTS public."GYNCardGeneration_GYNCardGenerationId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;

ALTER SEQUENCE public."GYNCardGeneration_GYNCardGenerationId_seq"
    OWNER TO postgres;




-- Table: public.GYNCardGeneration

-- DROP TABLE IF EXISTS public."GYNCardGeneration";

CREATE TABLE IF NOT EXISTS public."GYNCardGeneration"
(
    "GYNCardGenerationId" integer NOT NULL DEFAULT nextval('"GYNCardGeneration_GYNCardGenerationId_seq"'::regclass),
    "Department" text COLLATE pg_catalog."default",
    "GYNNo" character varying(255) COLLATE pg_catalog."default",
    "HusbandName" character varying(255) COLLATE pg_catalog."default",
    "HusbandAge" integer,
    "Remarks" text COLLATE pg_catalog."default",
    "RegistrationDate" text COLLATE pg_catalog."default",
    "GYNNoExists" text COLLATE pg_catalog."default",
    "Active" boolean DEFAULT true,
    "ProviderId" integer NOT NULL,
    "PatientId" integer NOT NULL,
    CONSTRAINT "GYNCardGeneration_pkey" PRIMARY KEY ("GYNCardGenerationId"),
    CONSTRAINT "FK_GYNCardGeneration_PatientId" FOREIGN KEY ("PatientId")
        REFERENCES public."Patient" ("PatientId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "FK_GYNCardGeneration_ProviderId" FOREIGN KEY ("ProviderId")
        REFERENCES public."Provider" ("ProviderId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public."GYNCardGeneration"
    OWNER to postgres;
