Messages now sending/loading and populating on message dropdown

This commit is contained in:
2025-10-31 12:08:38 +00:00
parent 776ea53a66
commit 8529116ad2
13 changed files with 136 additions and 81 deletions

View File

@@ -140,20 +140,20 @@ CREATE TABLE IF NOT EXISTS my_tickets (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- USERS MESSAGES
CREATE TABLE IF NOT EXISTS users_messages (
CREATE TABLE IF NOT EXISTS user_messages (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
senderId BIGINT UNSIGNED NOT NULL,
recipientId BIGINT UNSIGNED NOT NULL,
subject VARCHAR(255) NOT NULL,
message MEDIUMTEXT,
body MEDIUMTEXT,
is_read TINYINT(1) NOT NULL DEFAULT 0,
is_archived TINYINT(1) NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
archived_at DATETIME NULL,
CONSTRAINT fk_users_messages_sender
CONSTRAINT fk_user_messages_sender
FOREIGN KEY (senderId) REFERENCES users(id)
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT fk_users_messages_recipient
CONSTRAINT fk_user_messages_recipient
FOREIGN KEY (recipientId) REFERENCES users(id)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;