add project_id and company_id to reports

update doc
This commit is contained in:
iIronside
2023-11-03 12:01:29 +03:00
parent 52f8cb312f
commit ae44789200
7 changed files with 589 additions and 12 deletions

View File

@ -0,0 +1,34 @@
<?php
use yii\db\Migration;
/**
* Class m231102_113213_add_column_project_id_reports_table
*/
class m231102_113213_add_column_project_id_reports_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('reports', 'project_id', $this->integer()->defaultValue(null));
$this->addForeignKey(
'reports_project_id',
'reports',
'project_id',
'project',
'id'
);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropForeignKey('reports_project_id', 'reports');
$this->dropColumn('reports', 'project_id');
}
}

View File

@ -0,0 +1,34 @@
<?php
use yii\db\Migration;
/**
* Class m231102_113324_add_column_company_id_reports_table
*/
class m231102_113324_add_column_company_id_reports_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('reports', 'company_id', $this->integer()->defaultValue(null));
$this->addForeignKey(
'reports_company_id',
'reports',
'company_id',
'project',
'id'
);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropForeignKey('reports_company_id', 'reports');
$this->dropColumn('reports', 'company_id');
}
}