Fix merge with upstream
This commit is contained in:
@ -21,7 +21,7 @@ class m000000_000002_create_profile_table extends Migration
|
||||
$this->createTable(
|
||||
'{{%profile}}',
|
||||
[
|
||||
'user_id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer()->notNull(),
|
||||
'name' => $this->string(255),
|
||||
'public_email' => $this->string(255),
|
||||
'gravatar_email' => $this->string(255),
|
||||
@ -34,6 +34,8 @@ class m000000_000002_create_profile_table extends Migration
|
||||
MigrationHelper::resolveTableOptions($this->db->driverName)
|
||||
);
|
||||
|
||||
$this->addPrimaryKey('{{%profile_pk}}','{{%profile}}','user_id');
|
||||
|
||||
$restrict = MigrationHelper::isMicrosoftSQLServer($this->db->driverName) ? 'NO ACTION' : 'RESTRICT';
|
||||
|
||||
$this->addForeignKey('fk_profile_user', '{{%profile}}', 'user_id', '{{%user}}', 'id', 'CASCADE', $restrict);
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Da\User\Migration;
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m000000_000007_enable_password_expiration extends Migration
|
||||
{
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn('{{%user}}', 'password_changed_at', $this->integer()->null());
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn('{{%user}}', 'password_changed_at');
|
||||
}
|
||||
}
|
||||
29
src/User/Migration/m000000_000008_add_last_login_ip.php
Normal file
29
src/User/Migration/m000000_000008_add_last_login_ip.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace Da\User\Migration;
|
||||
|
||||
use yii\db\Migration;
|
||||
use yii\db\Schema;
|
||||
|
||||
|
||||
/**
|
||||
* Class m000000_000008_add_last_login_ip
|
||||
* @author: Kartik Visweswaran
|
||||
*/
|
||||
class m000000_000008_add_last_login_ip extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn('{{%user}}', 'last_login_ip', Schema::TYPE_STRING . '(45) DEFAULT NULL AFTER last_login_at');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn('{{%user}}', 'last_login_ip');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user