Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

53 lines
1.0KB

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