m230609_070938_author_ext.php 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m230609_070938_author_ext
  5. */
  6. class m230609_070938_author_ext extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function safeUp()
  12. {
  13. $sql = "ALTER TABLE `authors` ADD `description` TEXT NULL DEFAULT NULL COMMENT 'описание' AFTER `jobTitle`, ADD `text` TEXT NULL DEFAULT NULL COMMENT 'описание' AFTER `description`;";
  14. $this->execute($sql);
  15. $sql = "ALTER TABLE `authors` ADD `show` INT UNSIGNED DEFAULT 0 COMMENT 'показывать страницу' AFTER `active`;COMMIT;";
  16. $this->execute($sql);
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function safeDown()
  22. {
  23. echo "m230609_070938_author_ext cannot be reverted.\n";
  24. return false;
  25. }
  26. /*
  27. // Use up()/down() to run migration code without a transaction.
  28. public function up()
  29. {
  30. }
  31. public function down()
  32. {
  33. echo "m230609_070938_author_ext cannot be reverted.\n";
  34. return false;
  35. }
  36. */
  37. }