You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* Table for User
*/
class m240605_070000_change_table_users extends \yii\db\Migration
{
public function safeUp()
{
$this->dropForeignKey('fk_users_current_company_id_companies_id', '{{%users}}');
$this->dropColumn('{{%users}}', 'current_company_id');
}
public function safeDown()
{
$this->addColumn('{{%users}}', 'current_company_id', $this->integer()->null()->defaultValue(null));
$this->addForeignKey('fk_users_current_company_id_companies_id', '{{%users}}', 'current_company_id', 'companies', 'id');
}
}
ACTUAL
/**
* Table for User
*/
class m240605_070000_change_table_users extends \yii\db\Migration
{
public function safeUp()
{
$this->dropForeignKey('fk_users_current_company_id_companies_id', '{{%users}}');
$this->dropColumn('{{%users}}', 'current_company_id');
}
public function safeDown()
{
$this->addColumn('{{%users}}', 'current_company_id', $this->integer()->null()->defaultValue(null));
$this->addForeignKey('fk_users_current_company_id_companies_id', '{{%users}}', 'id', 'companies', 'current_company_id');
}
}
BUG
The columns of the tables are swapped in the safeDown
The text was updated successfully, but these errors were encountered:
GIVEN
EXECUTE
remove from code
execute
EXPECTED
ACTUAL
BUG
The columns of the tables are swapped in the safeDown
The text was updated successfully, but these errors were encountered: