create table "WebNotificationLogType"(
		"WebNotificationLogTypeId" serial primary key,
		"LogType" varchar(250),
		"IsClickable" boolean default false,
		"Description" varchar(300)
);

insert into "WebNotificationLogType" ("LogType","IsClickable","Description")
values('Alert',false,'This is for alert'),
('View',true,'This is for view and clickable');

-----------------------------


create table "WebNotificationPriority"(
"WebNotificationPriorityId" serial primary key,
"Priority" varchar(250),
"Active" boolean default true
);

insert into "WebNotificationPriority"("Priority") values ('High'),('Medium'),('Low');


create table "WebNotification"(
  "WebNotificationId" serial primary key,  
  "Message" text,
  "WebNotificationPriorityId" int references "WebNotificationPriority"("WebNotificationPriorityId"),
  "WebNotificationLogTypeId" int references "WebNotificationLogType"("WebNotificationLogTypeId"),
  "CreatedDate" timestamp without time zone,
  "RedirectionLink" text,
  "AllowedRoles" text,
	"AllowedAccounts" text,
	"IsRead" boolean default true
);

--------

Alter table "WebNotification" add column "PatientId" int references "Patient"("PatientId");

------------------

Alter table "WebNotification" add column "ReferenceId" bigint;
-----------