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

12 lines
408 B
SQL

CREATE TABLE `surveys` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`coach_id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`description` text,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `coach_id` (`coach_id`),
CONSTRAINT `surveys_ibfk_1` FOREIGN KEY (`coach_id`) REFERENCES `coaches` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;