mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-07 02:57:34 +00:00
18 lines
658 B
SQL
18 lines
658 B
SQL
CREATE TABLE "notification_kinds" (
|
|
"id" SERIAL PRIMARY KEY,
|
|
"name" VARCHAR NOT NULL
|
|
);
|
|
|
|
CREATE UNIQUE INDEX "index_notification_kinds_on_name" ON "notification_kinds" ("name");
|
|
|
|
CREATE TABLE notifications (
|
|
"id" SERIAL PRIMARY KEY,
|
|
"is_read" BOOLEAN NOT NULL DEFAULT FALSE,
|
|
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
"recipient_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
|
|
"actor_id" INTEGER REFERENCES users (id) ON DELETE CASCADE,
|
|
"kind" INTEGER NOT NULL REFERENCES notification_kinds (id),
|
|
"content" TEXT
|
|
);
|
|
|
|
CREATE INDEX "index_notifications_on_recipient_id" ON "notifications" ("recipient_id");
|