This commit is contained in:
2026-01-10 17:22:49 +01:00
parent edcc1b5403
commit 674fabb715
21 changed files with 2135 additions and 489 deletions

View File

@@ -2,5 +2,10 @@ CREATE TABLE IF NOT EXISTS `huge`.`notes` (
`note_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`note_text` text NOT NULL,
`user_id` int(11) unsigned NOT NULL,
`note_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`note_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='user notes';
-- Foreign key constraint
ALTER TABLE `notes`
ADD CONSTRAINT `notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;

View File

@@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sender_id` int(11) NOT NULL,
`receiver_id` int(11) DEFAULT NULL,
`group_type` enum('admins','moderators','all_users') DEFAULT NULL,
`group_type` enum('admins','moderators','all_users','global') DEFAULT NULL,
`subject` varchar(255) NOT NULL,
`message` text NOT NULL,
`is_read` tinyint(1) NOT NULL DEFAULT 0,
@@ -11,7 +11,8 @@ CREATE TABLE IF NOT EXISTS `messages` (
PRIMARY KEY (`id`),
KEY `sender_id` (`sender_id`),
KEY `receiver_id` (`receiver_id`),
KEY `is_read` (`is_read`)
KEY `is_read` (`is_read`),
KEY `group_type` (`group_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Foreign key constraints