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

12 lines
474 B
SQL

CREATE TABLE `survey_questions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`survey_id` int(11) NOT NULL,
`question` text NOT NULL,
`type` enum('text','textarea','select','radio','checkbox') NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `survey_id` (`survey_id`),
CONSTRAINT `survey_questions_ibfk_1` FOREIGN KEY (`survey_id`) REFERENCES `surveys` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;