move Da\User migrations from resources to dedicated namespace

This commit is contained in:
resurtm
2016-12-13 13:27:43 +06:00
parent ab7665eea5
commit 51a8a2b335
4 changed files with 14 additions and 7 deletions

View File

@ -1,32 +0,0 @@
<?php
class m000000_000001_create_user_table extends \yii\db\Migration
{
public function up()
{
$this->createTable('{{%user}}', [
'id' => $this->primaryKey(),
'username' => $this->string(255)->notNull(),
'email' => $this->string(255)->notNull(),
'password_hash' => $this->string(60)->notNull(),
'auth_key' => $this->string(32)->notNull(),
'unconfirmed_email' => $this->string(255),
'registration_ip' => $this->string(45),
'flags' => $this->integer()->notNull()->defaultValue('0'),
'confirmed_at' => $this->integer(),
'blocked_at' => $this->integer(),
'updated_at' => $this->integer()->notNull(),
'created_at' =>$this->integer()->notNull()
]);
$this->createIndex('idx_user_username', '{{%user}}', 'username', true);
$this->createIndex('idx_user_email', '{{%user}}', 'email', true);
}
public function down()
{
$this->dropTable('{{%user}}');
}
}

View File

@ -1,30 +0,0 @@
<?php
class m000000_000002_create_profile_table extends \yii\db\Migration
{
public function up()
{
$this->createTable(
'{{%profile}}',
[
'user_id' => $this->primaryKey(),
'name' => $this->string(255),
'public_email' => $this->string(255),
'gravatar_email' => $this->string(255),
'gravatar_id' => $this->string(32),
'location' => $this->string(255),
'website'=> $this->string(255),
'timezone' => $this->string(40),
'bio' => $this->text()
]
);
$this->addForeignKey('fk_profile_user', '{{%profile}}', 'user_id', '{{%user}}', 'id', 'CASCADE', 'RESTRICT');
}
public function down()
{
$this->dropTable('{{%profile}}');
}
}

View File

@ -1,47 +0,0 @@
<?php
class m000000_000003_create_social_account_table extends \yii\db\Migration
{
public function up()
{
$this->createTable(
'{{%social_account}}',
[
'id' => $this->primaryKey(),
'user_id' => $this->integer(),
'provider' => $this->string(255)->notNull(),
'client_id' => $this->string(255)->notNull(),
'code' => $this->string(32),
'email' => $this->string(255),
'username' => $this->string(255),
'data' => $this->text(),
'created_at' => $this->integer()
]
);
$this->createIndex(
'idx_social_account_provider_client_id',
'{{%social_account}}',
['provider', 'client_id'],
true
);
$this->createIndex('idx_social_account_code', '{{%social_account}}', 'code', true);
$this->addForeignKey(
'fk_social_account_user',
'{{%social_account}}',
'user_id',
'{{%user}}',
'id',
'CASCADE',
'RESTRICT'
);
}
public function down()
{
$this->dropTable('{{%social_account}}');
}
}

View File

@ -1,27 +0,0 @@
<?php
class m000000_000004_create_token_table extends \yii\db\Migration
{
public function up()
{
$this->createTable(
'{{%token}}',
[
'user_id' => $this->integer(),
'code' => $this->string(32)->notNull(),
'type' => $this->smallInteger(6)->notNull(),
'created_at' => $this->integer()->notNull()
]
);
$this->createIndex('idx_token_user_id_code_type', '{{%token}}', ['user_id', 'code', 'type'], true);
$this->addForeignKey('fk_token_user', '{{%token}}', 'user_id', '{{%user}}', 'id', 'CASCADE', 'RESTRICT');
}
public function down()
{
$this->dropTable('{{%token}}');
}
}