Answer the question
In order to leave comments, you need to log in
How to format 'YEAR' column in yii2 migration?
I create a migration, the column in the database should be of type year(4) and look like this: '2016'.
If you do it like this:
public function up()
{
$this->createTable('films', [
...
'year' => $this->dateTime(),
...
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question