
CREATE SEQUENCE public."RoomCharge_RoomChargeId_seq";
----------
CREATE TABLE IF NOT EXISTS public."RoomCharge"
(
    "RoomChargeId" integer NOT NULL DEFAULT nextval('"RoomCharge_RoomChargeId_seq"'::regclass),
    "LocationId" integer,
    "ChargeCategoryId" integer,
    "Cost" numeric(10,2) NOT NULL,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,       
    CONSTRAINT "RoomCharge_pkey" PRIMARY KEY ("RoomChargeId"),
    CONSTRAINT "RoomChargeId_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "RoomCharge_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION ,
	CONSTRAINT "RoomCharge_ChargeCategoryId_fkey" FOREIGN KEY ("ChargeCategoryId")
        REFERENCES public."ChargeCategory" ("ChargeCategoryId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
------------------------
ALTER TABLE "Room"
ADD COLUMN "ChargeCategoryId" integer
ALTER TABLE "Room"
ADD CONSTRAINT "FK_Room_ChargeCategoryId" FOREIGN KEY ("ChargeCategoryId")
        REFERENCES public."ChargeCategory" ("ChargeCategoryId") 
------------------------------------------
ALTER TABLE "ChargeCategory"
Drop COLUMN "LocationId"
		