-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Description
I posted a question at #368 a bit earlier that I should have investigated more before posting. Sorry for that.
But one question regarding this still remains: apparently you can't set a default value of CURRENT_TIMESTAMP
at this point for timestamp
columns because setting a default value through the DB scheme creator is currently hardcoded with single quotes around the values.
/**
* Get the SQL for a default column modifier.
*
* @param Illuminate\Database\Schema\Blueprint $blueprint
* @param Illuminate\Support\Fluent $column
* @return string|null
*/
protected function modifyDefault(Blueprint $blueprint, Fluent $column)
{
if ( ! is_null($column->default))
{
return " default '".$this->getDefaultValue($column->default)."'";
}
}
Because of this you can't set default SQL constant values like CURRENT_TIMESTAMP because default 'CURRENT_TIMESTAMP'
will return a syntax error for your SQL query.
Can this perhaps be reviewed so you can set SQL constants as default values?
Metadata
Metadata
Assignees
Labels
No labels