DROP TABLE if exists  "DemandBook";

CREATE TABLE "DemandBook"
(
    "DemandBookId" serial Primary Key,
    "PharmacyProductId" integer,
    "PatientId" integer references "Patient"("PatientId"),
    "ProductName" text,
    "RequiredQty" integer,    
    "Active" boolean NOT NULL DEFAULT true,
    "CreatedBy" integer references "Account"("AccountId"),
    "CreatedDate" timestamp without time zone NOT NULL,
    "ModifiedBy" integer references "Account"("AccountId"),
    "ModifiedDate" timestamp(6) without time zone    
);