access - модуль
This commit is contained in:
29
console/migrations/m191021_085640_create_accesses_table.php
Normal file
29
console/migrations/m191021_085640_create_accesses_table.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%accesses}}`.
|
||||
*/
|
||||
class m191021_085640_create_accesses_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%accesses}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'name' => $this->string(),
|
||||
'access' => $this->string(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropTable('{{%accesses}}');
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%project_accesses}}`.
|
||||
*/
|
||||
class m191021_131536_create_project_accesses_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%project_accesses}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'accesses_id' => $this->integer(),
|
||||
'project_id' => $this->integer(),
|
||||
]);
|
||||
$this->addForeignKey('project_accesses_acc','project_accesses','accesses_id','accesses','id');
|
||||
$this->addForeignKey('project_accesses_prj','project_accesses','project_id','project','id');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropForeignKey('project_accesses_acc','project_accesses');
|
||||
$this->dropForeignKey('project_accesses_prj','project_accesses');
|
||||
$this->dropTable('{{%project_accesses}}');
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%user_card_accesses}}`.
|
||||
*/
|
||||
class m191021_133036_create_user_card_accesses_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%user_card_accesses}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'accesses_id' => $this->integer(),
|
||||
'user_card_id' => $this->integer(),
|
||||
]);
|
||||
$this->addForeignKey('user_card_accesses_acc','user_card_accesses','accesses_id','accesses','id');
|
||||
$this->addForeignKey('user_card_accesses_uscr','user_card_accesses','user_card_id','user_card','id');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropForeignKey('user_card_accesses_acc','user_card_accesses');
|
||||
$this->dropForeignKey('user_card_accesses_uscr','user_card_accesses');
|
||||
$this->dropTable('{{%user_card_accesses}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user