Answer the question
In order to leave comments, you need to log in
Syntax of migrations in Yii2?
1. Where can I find the current migration syntax for the current version of the framework? Because after the command in the console, the up() function was created and in it:
$this->createTable('testmig', [
'id' => $this->primaryKey(),
]);
$this->createTable('news', [
'id' => Schema::TYPE_PK,
'title' => Schema::TYPE_STRING . ' NOT NULL',
'content' => Schema::TYPE_TEXT,
]);
'title' => $this->string(),
Answer the question
In order to leave comments, you need to log in
1. Both options are working, the first one on your list is newer, appeared in version 2.0.6
2.
'price' => $this->decimal(10, 2) // DECIMAL
'name' => $this->string(32) // varchar
либо 'name' => $this->char(8)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question