-- SEQUENCE: public.ConsultationType_ConsultationTypeId_seq

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

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

ALTER SEQUENCE public."ConsultationType_ConsultationTypeId_seq"
    OWNER TO postgres;



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


-- Table: public.ConsultationType

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

CREATE TABLE IF NOT EXISTS public."ConsultationType"
(
    "ConsultationTypeId" integer NOT NULL DEFAULT nextval('"ConsultationType_ConsultationTypeId_seq"'::regclass),
    "Name" character varying(30) COLLATE pg_catalog."default",
    "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,
    "LocationId" integer,
    CONSTRAINT "ConsultationType_pkey" PRIMARY KEY ("ConsultationTypeId"),
    CONSTRAINT "FK_ConsultationType_CreatedBy" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE CASCADE
        ON DELETE CASCADE,
    CONSTRAINT "FK_ConsultationType_Modifiedby" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE CASCADE
        ON DELETE CASCADE
)

TABLESPACE pg_default;

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

COMMENT ON COLUMN public."ConsultationType"."ConsultationTypeId"
    IS ' ';