36834-vm/db/migrations/002_create_posts_table.sql
Flatlogic Bot 51894f9e94 1.1.1.1.2
2025-12-11 09:14:46 +00:00

7 lines
246 B
SQL

CREATE TABLE IF NOT EXISTS posts (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);