add project statistic to api
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%project_role}}`.
|
||||
*/
|
||||
class m231120_121208_create_project_role_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%project_role}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'title' => $this->string(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropTable('{{%project_role}}');
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Class m231120_122131_add_project_role_id_to_project_user_table
|
||||
*/
|
||||
class m231120_122131_add_project_role_id_to_project_user_table extends Migration
|
||||
{
|
||||
private const TABLE_NAME = 'project_user';
|
||||
private const TABLE_COLUMN = 'project_role_id';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(self::TABLE_NAME, self::TABLE_COLUMN, $this->integer()->defaultValue(null));
|
||||
|
||||
$this->addForeignKey(
|
||||
'project_role_project_user',
|
||||
self::TABLE_NAME,
|
||||
self::TABLE_COLUMN,
|
||||
'project_role',
|
||||
'id'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropForeignKey('project_role_project_user', self::TABLE_NAME);
|
||||
$this->dropColumn(self::TABLE_NAME, self::TABLE_COLUMN );
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles adding columns to table `{{%project_user}}`.
|
||||
*/
|
||||
class m231120_134302_add_status_column_to_project_user_table extends Migration
|
||||
{
|
||||
private const TABLE_NAME = 'project_user';
|
||||
private const TABLE_COLUMN = 'status';
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn(self::TABLE_NAME, self::TABLE_COLUMN, $this->integer()->defaultValue(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn(self::TABLE_NAME, self::TABLE_COLUMN);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user