您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

51 行
1001B

  1. <?php
  2. /**
  3. * This view is used by console/controllers/MigrateController.php
  4. * The following variables are available in this view:
  5. */
  6. /* @var $className string the new migration class name */
  7. /* @var $table string the name table */
  8. /* @var $fields array the fields */
  9. preg_match('/^drop_(.+)_columns?_from_(.+)_table$/', $name, $matches);
  10. $columns = $matches[1];
  11. echo "<?php\n";
  12. ?>
  13. use yii\db\Migration;
  14. /**
  15. * Handles dropping <?= $columns ?> from table `<?= $table ?>`.
  16. <?= $this->render('_foreignTables', [
  17. 'foreignKeys' => $foreignKeys,
  18. ]) ?>
  19. */
  20. class <?= $className ?> extends Migration
  21. {
  22. /**
  23. * @inheritdoc
  24. */
  25. public function up()
  26. {
  27. <?= $this->render('_dropColumns', [
  28. 'table' => $table,
  29. 'fields' => $fields,
  30. 'foreignKeys' => $foreignKeys,
  31. ])
  32. ?>
  33. }
  34. /**
  35. * @inheritdoc
  36. */
  37. public function down()
  38. {
  39. <?= $this->render('_addColumns', [
  40. 'table' => $table,
  41. 'fields' => $fields,
  42. 'foreignKeys' => $foreignKeys,
  43. ])
  44. ?>
  45. }
  46. }