Start work on storing notifications in the database
This commit is contained in:
parent
45f3a98359
commit
cf6ce0dbad
16 changed files with 399 additions and 2 deletions
|
@ -312,3 +312,22 @@ CREATE TABLE IF NOT EXISTS "observed_channel_messages" (
|
|||
);
|
||||
|
||||
CREATE UNIQUE INDEX "index_observed_channel_messages_user_and_channel_id" ON "observed_channel_messages" ("user_id", "channel_id");
|
||||
|
||||
CREATE TABLE "notification_kinds" (
|
||||
"id" INTEGER PRIMARY KEY NOT NULL,
|
||||
"name" VARCHAR NOT NULL,
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX "index_notification_kinds_on_name" ON "notification_kinds" ("name");
|
||||
|
||||
CREATE TABLE "notifications" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"created_at" TIMESTAMP NOT NULL default now,
|
||||
"recipent_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
|
||||
"kind" INTEGER NOT NULL REFERENCES notification_kinds (id),
|
||||
"is_read" BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
"entity_id_1" INTEGER,
|
||||
"entity_id_2" INTEGER
|
||||
);
|
||||
|
||||
CREATE INDEX "index_notifications_on_recipient_id" ON "notifications" ("recipient_id");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue