accounts/console/migrations/m160512_194546_account_language.php

18 lines
520 B
PHP
Raw Normal View History

<?php
use console\db\Migration;
class m160512_194546_account_language extends Migration {
public function safeUp() {
$this->addColumn('{{%accounts}}', 'lang', $this->string(5)->notNull()->defaultValue('en')->after('password_hash_strategy'));
$this->dropColumn('{{%accounts}}', 'password_reset_token');
}
public function safeDown() {
$this->dropColumn('{{%accounts}}', 'lang');
$this->addColumn('{{%accounts}}', 'password_reset_token', $this->string()->unique());
}
}