-- Table: public.Customer
-- DROP TABLE IF EXISTS public."Customer";
CREATE TABLE IF NOT EXISTS public."Customer"
(
"CustomerId" integer NOT NULL,
"FirstName" character varying(40) COLLATE pg_catalog."default" NOT NULL,
"LastName" character varying(20) COLLATE pg_catalog."default" NOT NULL,
"Company" character varying(80) COLLATE pg_catalog."default",
"Address" character varying(70) COLLATE pg_catalog."default",
"City" character varying(40) COLLATE pg_catalog."default",
"State" character varying(40) COLLATE pg_catalog."default",
"Country" character varying(40) COLLATE pg_catalog."default",
"PostalCode" character varying(10) COLLATE pg_catalog."default",
"Phone" character varying(24) COLLATE pg_catalog."default",
"Fax" character varying(24) COLLATE pg_catalog."default",
"Email" character varying(60) COLLATE pg_catalog."default" NOT NULL,
"SupportRepId" integer,
CONSTRAINT "PK_Customer" PRIMARY KEY ("CustomerId"),
CONSTRAINT "FK_CustomerSupportRepId" FOREIGN KEY ("SupportRepId")
REFERENCES public."Employee" ("EmployeeId") MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public."Customer"
OWNER to postgres;
-- Index: IFK_CustomerSupportRepId
-- DROP INDEX IF EXISTS public."IFK_CustomerSupportRepId";
CREATE INDEX IF NOT EXISTS "IFK_CustomerSupportRepId"
ON public."Customer" USING btree
("SupportRepId" ASC NULLS LAST)
TABLESPACE pg_default;