portal.mkgtu.ru/common/migrations/db/m160615_115524_set_nullable...

19 lines
463 B
PHP
Raw Normal View History

2024-03-28 09:51:45 +03:00
<?php
use common\components\Migration\MigrationWithDefaultOptions;
class m160615_115524_set_nullable_email extends MigrationWithDefaultOptions
{
public function safeUp()
{
$this->alterColumn('{{%user}}', 'email', $this->string());
Yii::$app->db->schema->refresh();
}
public function safeDown()
{
$this->alterColumn('{{%user}}', 'email', $this->string()->notNull());
Yii::$app->db->schema->refresh();
}
}