migration.php 957 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * This view is used by console/controllers/MigrateController.php.
  4. *
  5. * The following variables are available in this view:
  6. */
  7. /* @var $className string the new migration class name without namespace */
  8. /* @var $namespace string the new migration class namespace */
  9. echo "<?php\n";
  10. if (!empty($namespace)) {
  11. echo "\nnamespace {$namespace};\n";
  12. }
  13. ?>
  14. use yii\db\Migration;
  15. /**
  16. * Class <?= $className . "\n" ?>
  17. */
  18. class <?= $className ?> extends Migration
  19. {
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeUp()
  24. {
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function safeDown()
  30. {
  31. echo "<?= $className ?> cannot be reverted.\n";
  32. return false;
  33. }
  34. /*
  35. // Use up()/down() to run migration code without a transaction.
  36. public function up()
  37. {
  38. }
  39. public function down()
  40. {
  41. echo "<?= $className ?> cannot be reverted.\n";
  42. return false;
  43. }
  44. */
  45. }