diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fefe2c..6b3c222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.0.13 - Work in progress - Fix #49: Fix wrong call of method make() for set attributes (MKiselev) +- Enh #46: Use safeUp()/safeDown() instead up()/down() in migrations (MKiselev) +- Fix #51: Typo fix rememberLoginLifeSpan to rememberLoginLifespan (MKiselev) ## 1.0.12 - August 6, 2017 - Bug Fix: Modify ResetPasswordService to forcely update password_hash field (tonydspaniard) diff --git a/src/User/Migration/m000000_000001_create_user_table.php b/src/User/Migration/m000000_000001_create_user_table.php index 4c7432b..2f1b921 100644 --- a/src/User/Migration/m000000_000001_create_user_table.php +++ b/src/User/Migration/m000000_000001_create_user_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000001_create_user_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%user}}', @@ -41,7 +41,7 @@ class m000000_000001_create_user_table extends Migration $this->createIndex('idx_user_email', '{{%user}}', 'email', true); } - public function down() + public function safeDown() { $this->dropTable('{{%user}}'); } diff --git a/src/User/Migration/m000000_000002_create_profile_table.php b/src/User/Migration/m000000_000002_create_profile_table.php index 3f20778..44f0490 100644 --- a/src/User/Migration/m000000_000002_create_profile_table.php +++ b/src/User/Migration/m000000_000002_create_profile_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000002_create_profile_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%profile}}', @@ -39,7 +39,7 @@ class m000000_000002_create_profile_table extends Migration $this->addForeignKey('fk_profile_user', '{{%profile}}', 'user_id', '{{%user}}', 'id', 'CASCADE', $restrict); } - public function down() + public function safeDown() { $this->dropTable('{{%profile}}'); } diff --git a/src/User/Migration/m000000_000003_create_social_account_table.php b/src/User/Migration/m000000_000003_create_social_account_table.php index feb87fb..8561325 100644 --- a/src/User/Migration/m000000_000003_create_social_account_table.php +++ b/src/User/Migration/m000000_000003_create_social_account_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000003_create_social_account_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%social_account}}', @@ -54,7 +54,7 @@ class m000000_000003_create_social_account_table extends Migration ); } - public function down() + public function safeDown() { $this->dropTable('{{%social_account}}'); } diff --git a/src/User/Migration/m000000_000004_create_token_table.php b/src/User/Migration/m000000_000004_create_token_table.php index 10aeb51..e28c7d5 100644 --- a/src/User/Migration/m000000_000004_create_token_table.php +++ b/src/User/Migration/m000000_000004_create_token_table.php @@ -16,7 +16,7 @@ use yii\db\Migration; class m000000_000004_create_token_table extends Migration { - public function up() + public function safeUp() { $this->createTable( '{{%token}}', @@ -36,7 +36,7 @@ class m000000_000004_create_token_table extends Migration $this->addForeignKey('fk_token_user', '{{%token}}', 'user_id', '{{%user}}', 'id', 'CASCADE', $restrict); } - public function down() + public function safeDown() { $this->dropTable('{{%token}}'); } diff --git a/src/User/Migration/m000000_000005_add_last_login_at.php b/src/User/Migration/m000000_000005_add_last_login_at.php index 68807ed..2a0c031 100644 --- a/src/User/Migration/m000000_000005_add_last_login_at.php +++ b/src/User/Migration/m000000_000005_add_last_login_at.php @@ -15,12 +15,12 @@ use yii\db\Migration; class m000000_000005_add_last_login_at extends Migration { - public function up() + public function safeUp() { $this->addColumn('{{%user}}', 'last_login_at', $this->integer()); } - public function down() + public function safeDown() { $this->dropColumn('{{%user}}', 'last_login_at'); } diff --git a/src/User/Service/SocialNetworkAuthenticateService.php b/src/User/Service/SocialNetworkAuthenticateService.php index 4787fca..1e621f9 100644 --- a/src/User/Service/SocialNetworkAuthenticateService.php +++ b/src/User/Service/SocialNetworkAuthenticateService.php @@ -74,7 +74,7 @@ class SocialNetworkAuthenticateService implements ServiceInterface Yii::$app->session->setFlash('danger', Yii::t('usuario', 'Your account has been blocked.')); $this->authAction->setSuccessUrl(Url::to(['/user/security/login'])); } else { - Yii::$app->user->login($account->user, $this->controller->module->rememberLoginLifeSpan); + Yii::$app->user->login($account->user, $this->controller->module->rememberLoginLifespan); $this->authAction->setSuccessUrl(Yii::$app->getUser()->getReturnUrl()); } } else {