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.

49 lines
914B

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