34 lines
768 B
PHP
34 lines
768 B
PHP
|
<?php
|
||
|
|
||
|
use yii\db\Migration;
|
||
|
|
||
|
/**
|
||
|
* Handles the creation of table `{{%profile}}`.
|
||
|
*/
|
||
|
class m230503_151339_create_profile_table extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function safeUp()
|
||
|
{
|
||
|
$this->createTable('{{%profile}}', [
|
||
|
'id' => $this->primaryKey(),
|
||
|
'user_id' => $this->integer(),
|
||
|
'created_at' => $this->timestamp(),
|
||
|
'image' => $this->string(),
|
||
|
'activity' => $this->tinyInteger()
|
||
|
]);
|
||
|
$this->addForeignKey('user_foreign', 'profile', 'user_id', 'user', 'id');
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function safeDown()
|
||
|
{
|
||
|
$this->dropForeignKey('user_foreign', 'profile');
|
||
|
$this->dropTable('{{%profile}}');
|
||
|
}
|
||
|
}
|