I'm using the following method to create a database column of type ENUM
in schema builder:
$table->enum('status', array('new', 'active', 'disabled'));
I'd like to set it's default value to active
.
I tried to do this:
$table->enum('status', array('new', 'active', 'disabled'))->default('active');
But as you can guess it doesn't set it's default value. I'm using a MySQL database if that's important.
Best Solution
From the MySQL manual:
I'm assuming this means you should set
'active'
as the first value, remove thedefault()
call, and possibly setNULL
permittance manually.