12 lines
375 B
SQL
12 lines
375 B
SQL
|
|
CREATE TABLE IF NOT EXISTS `messages` (
|
|
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
|
`sender_id` INT NOT NULL,
|
|
`recipient_id` INT NOT NULL,
|
|
`content` TEXT NOT NULL,
|
|
`is_read` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY (`sender_id`) REFERENCES `users`(`id`),
|
|
FOREIGN KEY (`recipient_id`) REFERENCES `users`(`id`)
|
|
);
|