Updated validation for the project

This commit is contained in:
iIronside
2023-10-13 15:44:16 +03:00
parent e712f2fc36
commit b004f6e21b
2 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,31 @@
<?php
use yii\db\Migration;
/**
* Class m231013_122324_add_foreign_key_in_project_from_owner_id_to_user_id
*/
class m231013_122324_add_foreign_key_in_project_from_owner_id_to_user_id extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addForeignKey(
'project_user',
'project',
'owner_id',
'user',
'id'
);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropForeignKey('project_user', 'project');
}
}