35665-vm/db/migrations/004_create_choices_table.sql
2025-11-12 15:23:26 +00:00

9 lines
312 B
SQL

CREATE TABLE IF NOT EXISTS choices (
id INT AUTO_INCREMENT PRIMARY KEY,
question_id INT NOT NULL,
choice_text TEXT NOT NULL,
is_correct BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (question_id) REFERENCES questions(id) ON DELETE CASCADE
);