|
- <?php
-
-
-
-
-
- preg_match('/^drop_(.+)_columns?_from_(.+)_table$/', $name, $matches);
- $columns = $matches[1];
-
- echo "<?php\n";
- if (!empty($namespace)) {
- echo "\nnamespace {$namespace};\n";
- }
- ?>
-
- use yii\db\Migration;
-
-
- class <?= $className ?> extends Migration
- {
-
-
- public function up()
- {
- <?= $this->render('_dropColumns', [
- 'table' => $table,
- 'fields' => $fields,
- 'foreignKeys' => $foreignKeys,
- ])
- ?>
- }
-
-
-
- public function down()
- {
- <?= $this->render('_addColumns', [
- 'table' => $table,
- 'fields' => $fields,
- 'foreignKeys' => $foreignKeys,
- ])
- ?>
- }
- }
|