first commit
This commit is contained in:
33
console/migrations/m230503_151339_create_profile_table.php
Executable file
33
console/migrations/m230503_151339_create_profile_table.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?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}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user