migration.php 837 B

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