|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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,
- ])
- ?>
- }
- }
|