File manager - Edit - /home/webapp69.cm.in.th/u69319090028/Shop/database/migrations/notification_system.sql
Back
-- ============================================================ -- CARGOO Centralized Notification System Migration -- Run against: cargoo_shop -- ============================================================ CREATE TABLE IF NOT EXISTS `notifications` ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `user_id` INT UNSIGNED NOT NULL COMMENT 'FK to users', `role_target` ENUM('customer','seller','admin') NOT NULL DEFAULT 'customer', `type` VARCHAR(64) NOT NULL COMMENT 'e.g. order_created, payment_confirmed, review_received', `title` VARCHAR(255) NOT NULL, `message` TEXT NOT NULL, `target_type` VARCHAR(64) DEFAULT NULL COMMENT 'e.g. order, product, store, payment, review, report', `target_id` INT UNSIGNED DEFAULT NULL, `action_url` VARCHAR(255) DEFAULT NULL, `is_read` TINYINT(1) NOT NULL DEFAULT 0, `read_at` DATETIME DEFAULT NULL, `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `idx_notif_user_read` (`user_id`, `is_read`, `created_at`), KEY `idx_notif_target` (`target_type`, `target_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Centralized in-app notifications';
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.24 |
proxy
|
phpinfo
|
Settings