public function safeUp()
{
$this->addColumn('order','pickup',$this->boolean()->defaultValue(false));
$this->alterColumn('order','street',$this->string(255)->notNull()->defaultValue('нет'));
$this->alterColumn('order','house',$this->integer()->notNull()->defaultValue(0));
$this->alterColumn('order','flat',$this->integer()->notNull()->defaultValue(0));
}
> add column pickup boolean DEFAULT FALSE to table order ... done (time: 0.020s)
> alter column street in table order to string(255) NOT NULL DEFAULT 'нет' ...Exception: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "NOT"
LINE 1: ...E "order" ALTER COLUMN "street" TYPE varchar(255) NOT NULL D...
^
The SQL being executed was: ALTER TABLE "order" ALTER COLUMN "street" TYPE varchar(255) NOT NULL DEFAULT 'нет' (/var/www/ecoprod.dev/vendor/yiisoft/yii2/db/Schema.php:595)
#0 /var/www/ecoprod.dev/vendor/yiisoft/yii2/db/Command.php(1004): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE "or...')
#1 /var/www/ecoprod.dev/vendor/yiisoft/yii2/db/Migration.php(396): yii\db\Command->execute()
#2 /var/www/ecoprod.dev/console/migrations/m171219_130519_add_column_pickup_from_order.php(16): yii\db\Migration->alterColumn('order', 'street', Object(yii\db\ColumnSchemaBuilder))
#3 /var/www/ecoprod.dev/vendor/yiisoft/yii2/db/Migration.php(114): m171219_130519_add_column_pickup_from_order->safeUp()
#4 /var/www/ecoprod.dev/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(725): yii\db\Migration->up()
#5 /var/www/ecoprod.dev/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(199): yii\console\controllers\BaseMigrateController->migrateUp('m171219_130519_...')
#6 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#7 /var/www/ecoprod.dev/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /var/www/ecoprod.dev/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /var/www/ecoprod.dev/vendor/yiisoft/yii2/console/Controller.php(135): yii\base\Controller->runAction('', Array)
#10 /var/www/ecoprod.dev/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('', Array)
#11 /var/www/ecoprod.dev/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#12 /var/www/ecoprod.dev/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#13 /var/www/ecoprod.dev/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#14 /var/www/ecoprod.dev/yii(27): yii\base\Application->run()
#15 {main}
*** failed to apply m171219_130519_add_column_pickup_from_order (time: 0.028s)
$add=$product->addFeild;
$add[$key]=$model->value;
$add->save();
Call to a member function save() on array
$add=$product->addFeild;
$add[$key]=$model->value;
$product->save();