
CREATE TABLE "PatientChatBox" (
	"PatientChatBoxId" serial NOT NULL,
	"CreatedBy" int4 NOT NULL,
	"CreatedDate" timestamp without time zone NOT NULL,
	"Message" text NOT NULL,
	"AppointmentId" int4 NOT NULL,
	CONSTRAINT "PatientChatBoxId_pkey" PRIMARY KEY ("PatientChatBoxId")
);


-- public."PatientChatBox" foreign keys

ALTER TABLE public."PatientChatBox" ADD CONSTRAINT "PatientChatBoxId_AppointmentId_fkey" FOREIGN KEY ("AppointmentId") REFERENCES "Appointment"("AppointmentId");
ALTER TABLE public."PatientChatBox" ADD CONSTRAINT "PatientChatBoxId_CreatedBy_fkey" FOREIGN KEY ("CreatedBy") REFERENCES "Account"("AccountId");
----------