Update: 2026-05-08 01:41:28

This commit is contained in:
Hamza-Ayed
2026-05-08 01:41:28 +03:00
parent 6b4e7721ee
commit ed8203a02e
15 changed files with 855 additions and 79 deletions

View File

@@ -0,0 +1,18 @@
-- Notifications Table
CREATE TABLE IF NOT EXISTS notifications (
id CHAR(36) PRIMARY KEY,
user_id CHAR(36) NOT NULL,
tenant_id CHAR(36) NOT NULL,
title VARCHAR(255) NOT NULL,
body TEXT,
type ENUM('info', 'success', 'warning', 'error') DEFAULT 'info',
category VARCHAR(50) DEFAULT 'general',
entity_type VARCHAR(50) NULL,
entity_id CHAR(36) NULL,
is_read TINYINT(1) DEFAULT 0,
read_at TIMESTAMP NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_user_read (user_id, is_read),
INDEX idx_tenant (tenant_id),
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;