add employee module
This commit is contained in:
30
console/migrations/m211115_125911_create_manager_table.php
Normal file
30
console/migrations/m211115_125911_create_manager_table.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%manager}}`.
|
||||
*/
|
||||
class m211115_125911_create_manager_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%manager}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
]);
|
||||
$this->addForeignKey('manager_user', 'manager', 'user_id', 'user', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropForeignKey('manager_user', 'manager');
|
||||
$this->dropTable('{{%manager}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user