mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-02-10 05:23:09 +00:00
15 lines
532 B
MySQL
15 lines
532 B
MySQL
|
|
-- Notifications table
|
||
|
|
CREATE TABLE notifications (
|
||
|
|
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||
|
|
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||
|
|
type VARCHAR(50) NOT NULL,
|
||
|
|
title VARCHAR(255) NOT NULL,
|
||
|
|
message TEXT,
|
||
|
|
link VARCHAR(500),
|
||
|
|
is_read BOOLEAN NOT NULL DEFAULT false,
|
||
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE INDEX idx_notifications_user ON notifications(user_id);
|
||
|
|
CREATE INDEX idx_notifications_unread ON notifications(user_id, is_read) WHERE is_read = false;
|