-- SEQUENCE: public.ProviderBreak_ProviderBreakId_seq

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

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

ALTER SEQUENCE public."srrrreeeeeer_ProviderBreakId_seq"
    OWNER TO postgres;


------------------------------------


-- Table: public.ProviderBreak

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

CREATE TABLE IF NOT EXISTS public."ProviderBreak"
(
    "ProviderBreakId" integer NOT NULL DEFAULT nextval('"ProviderBreak_ProviderBreakId_seq"'::regclass),
    "ProviderId" integer NOT NULL,
    "LocationId" integer NOT NULL,
    "ConsultationTypeId" integer,
    "Active" boolean NOT NULL DEFAULT true,
    "CreatedBy" integer NOT NULL,
    "CreatedDate" timestamp(6) without time zone NOT NULL,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp(6) without time zone,
    "StartDate" character varying COLLATE pg_catalog."default",
    "EndDate" character varying COLLATE pg_catalog."default",
    "SpecializationId" integer,
    "BreakDay" text COLLATE pg_catalog."default",
    "StartTime" text COLLATE pg_catalog."default",
    "EndTime" text COLLATE pg_catalog."default",
    "BreakDate" text COLLATE pg_catalog."default",
    "BreakType" character varying COLLATE pg_catalog."default",
    "BreakBlock" character varying COLLATE pg_catalog."default",
    CONSTRAINT "ProviderBreak_pkey" PRIMARY KEY ("ProviderBreakId"),
    CONSTRAINT "FK_ProviderBreak_ProviderId" FOREIGN KEY ("ProviderId")
        REFERENCES public."Provider" ("ProviderId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE,
    CONSTRAINT "ProviderBreak_ConsultationTypeId_fkey" FOREIGN KEY ("ConsultationTypeId")
        REFERENCES public."ConsultationType" ("ConsultationTypeId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ProviderBreak_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ProviderBreak_SpecializationId_fkey" FOREIGN KEY ("SpecializationId")
        REFERENCES public."Specialization" ("SpecializationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

TABLESPACE pg_default;

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

COMMENT ON COLUMN public."ProviderBreak"."ProviderBreakId"
    IS ' ';



----------