Answer the question
In order to leave comments, you need to log in
How to put an array in a table in Yii2 migration?
Here is the code for creating and writing data... I don't like calling insert every time
public function safeUp()
{
$this->createTable('specialnost', [
'id' => $this->primaryKey(),
'title' => $this->string()->notNull(),
]);
$this->insert('specialnost', [
'title' => 'Администратор',
]);
$this->insert('specialnost', [
'title' => 'Бухгалтер',
]);
............
}
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