Padre2018-02-05 18:59:11
Padre, 2018-02-05 18:59:11

A couple of questions about Yii2 migrations?

1. How to add a mediumint field? Such a line returns an error: 'Calling unknown method: m180605_132222_create_tbname_table::mediumint()' 2. How to create a field with some default value, for example, so that int would be 0 immediately, and in string the word 'vasya'
'label' => $this->mediumint(),

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Dmitry Kim, 2018-02-05

1. 'label' => 'MEDIUMINT'or 'label' => 'MEDIUMINT(x)'
2.'label' => $this->integer()->defaultValue(0)

'label' => $this->string(128)->defaultValue('vasya')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question