mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Добавлено запоминание последнего изменения пароля, удалено поле auth_key, поправлена загрузка фикстур для функциональных тестов
This commit is contained in:
21
console/migrations/m160311_211107_password_change_time.php
Normal file
21
console/migrations/m160311_211107_password_change_time.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use console\db\Migration;
|
||||
|
||||
class m160311_211107_password_change_time extends Migration {
|
||||
|
||||
public function safeUp() {
|
||||
$this->addColumn('{{%accounts}}', 'password_changed_at', $this->integer()->notNull());
|
||||
$this->getDb()->createCommand('
|
||||
UPDATE {{%accounts}}
|
||||
SET password_changed_at = created_at
|
||||
')->execute();
|
||||
$this->dropColumn('{{%accounts}}', 'auth_key');
|
||||
}
|
||||
|
||||
public function safeDown() {
|
||||
$this->dropColumn('{{%accounts}}', 'password_changed_at');
|
||||
$this->addColumn('{{%accounts}}', 'auth_key', $this->string(32)->notNull() . ' AFTER `status`');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user