Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Dec 5, 2024
1 parent 3d61609 commit 9f0f8c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ee/tabby-db/migrations/0039_add-notification-inbox.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ CREATE TABLE readed_notifications (
created_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
updated_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),

CONSTRAINT idx_unique_user_id_notification_id UNIQUE (user_id, notification_id),

FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (notification_id) REFERENCES notifications(id) ON DELETE CASCADE
)
Binary file modified ee/tabby-db/schema.sqlite
Binary file not shown.
3 changes: 2 additions & 1 deletion ee/tabby-db/schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ CREATE TABLE notifications(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
created_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
updated_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
-- enum of ADMIN, ALL_USERS
-- enum of admin, all_user
kind VARCHAR(255) NOT NULL DEFAULT 'admin',
-- content of notification, in markdown format.
content TEXT NOT NULL
Expand All @@ -238,6 +238,7 @@ CREATE TABLE readed_notifications(
notification_id INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
updated_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),
CONSTRAINT idx_unique_user_id_notification_id UNIQUE(user_id, notification_id),
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY(notification_id) REFERENCES notifications(id) ON DELETE CASCADE
);

0 comments on commit 9f0f8c1

Please sign in to comment.