52 lines
751 B
PHP
52 lines
751 B
PHP
|
<?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,
|
||
|
])
|
||
|
?>
|
||
|
}
|
||
|
}
|