Create table "PatientLabHeader"(
"PatientLabHeaderId" serial Primary Key,
"AppointmentId" integer,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp without time zone,
    "Active" boolean DEFAULT true,
    CONSTRAINT "PatientLabHeader_AppointmentId_fkey" FOREIGN KEY ("AppointmentId")
        REFERENCES public."Appointment" ("AppointmentId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "PatientLabHeader_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "PatientLabHeader_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION	
);

Create table "PatientLabDetail"(
	"PatientLabDetailId" serial Primary Key,
	"PatientLabHeaderId" int references "PatientLabHeader"("PatientLabHeaderId"),
	"LabHeaderId" int references "LabHeader"("LabHeaderId"),
	"LabPackageId" int references "LabPackage"("LabPackageId")
);
-------------------
Create table "WebNotificationType"("WebNotificationTypeId" serial Primary Key, "ModuleType" text);

Alter table "WebNotification" add column "WebNotificationTypeId" int references "WebNotificationType"("WebNotificationTypeId");

insert into "WebNotificationType" ("ModuleType")values('Pharmacy'),('Labratory');

-- Select * from "WebNotificationType"

update "WebNotification" set "WebNotificationTypeId" = 1;
--------------------------------