portal.mkgtu.ru/common/db/views/dropColumnMigration.php

52 lines
751 B
PHP
Raw Permalink Normal View History

2024-03-28 09:51:45 +03:00
<?php
echo "<?php\n";
if (!empty($namespace)) {
echo "\nnamespace {$namespace};\n";
}
?>
use common\components\Migration\SafeMigration;
/**
* Handles dropping columns from table `<?= $table ?>`.
<?= $this->render('_foreignTables', [
'foreignKeys' => $foreignKeys,
]) ?>
*/
class <?= $className ?> extends SafeMigration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
<?= $this->render('_dropColumns', [
'table' => $table,
'fields' => $fields,
'foreignKeys' => $foreignKeys,
])
?>
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
<?= $this->render('_addColumns', [
'table' => $table,
'fields' => $fields,
'foreignKeys' => $foreignKeys,
])
?>
}
}