Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Enum Migration
  • Hey, I'm currently trying to create a migration with an enum. Everytime I try to migrate, it breaks because it doesn't like the NOT NULL or the NULL value after the enum. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL,
    `created_at` int(11) NOT NULL,
    `updated_at` int(11) NOT NULL,
    PRIMARY K' at line 3 [ CREATE TABLE IF NOT EXISTS `my_table` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `my_enum` enum NOT NULL,
    `created_at` int(11) NOT NULL,
    `updated_at` int(11) NOT NULL,
    PRIMARY KEY `id` (`id`) Any help would be much appreciated!
  • 'my_enum' => array('constraint' => "'value_1','value_2','value_3'", 'type' => 'enum', 'default' => 'value_1'),
    

    That should work.
  • That worked! Thanks Syntaqx!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion