You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
867B

  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. echo "<?php\n";
  10. ?>
  11. use yii\db\Migration;
  12. /**
  13. * Handles the dropping for table `<?= $table ?>`.
  14. <?= $this->render('_foreignTables', [
  15. 'foreignKeys' => $foreignKeys,
  16. ]) ?>
  17. */
  18. class <?= $className ?> extends Migration
  19. {
  20. /**
  21. * @inheritdoc
  22. */
  23. public function up()
  24. {
  25. <?= $this->render('_dropTable', [
  26. 'table' => $table,
  27. 'foreignKeys' => $foreignKeys,
  28. ])
  29. ?>
  30. }
  31. /**
  32. * @inheritdoc
  33. */
  34. public function down()
  35. {
  36. <?= $this->render('_createTable', [
  37. 'table' => $table,
  38. 'fields' => $fields,
  39. 'foreignKeys' => $foreignKeys,
  40. ])
  41. ?>
  42. }
  43. }