36716-vm/db/migrations/015_create_messages_table.sql
2025-12-07 05:00:42 +00:00

11 lines
353 B
SQL

CREATE TABLE IF NOT EXISTS messages (
id INT AUTO_INCREMENT PRIMARY KEY,
sender_id INT NOT NULL,
sender_type ENUM('coach', 'client') NOT NULL,
receiver_id INT NOT NULL,
receiver_type ENUM('coach', 'client') NOT NULL,
message TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
is_read BOOLEAN DEFAULT FALSE
);