Hey Hey,
Im in the process of creating some migrations for a sample thing im writing, i have the original SQL table structure but im having a little trouble when it comes to the primary key, key, and constraint at the bottom.
I would really appreciate some help. The SQL is as follows;
CREATE TABLE `poll_options` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`poll_id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
`status` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `poll_id` (`poll_id`),
CONSTRAINT `poll_options_ibfk_1` FOREIGN KEY (`poll_id`) REFERENCES `polls` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;