migration.php 685 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. echo "<?php\n";
  8. ?>
  9. use yii\db\Migration;
  10. class <?= $className ?> extends Migration
  11. {
  12. public function up()
  13. {
  14. <?= $up ?>
  15. }
  16. public function down()
  17. {
  18. <?php if (!empty($down)):?>
  19. <?= $down ?>
  20. <?php else:?>
  21. echo "<?= $className ?> cannot be reverted.\n";
  22. <?php endif;?>
  23. }
  24. /*
  25. // Use safeUp/safeDown to run migration code within a transaction
  26. public function safeUp()
  27. {
  28. }
  29. public function safeDown()
  30. {
  31. }
  32. */
  33. }