123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- use yii\db\Migration;
- /**
- * Class m230609_070938_author_ext
- */
- class m230609_070938_author_ext extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "ALTER TABLE `authors` ADD `description` TEXT NULL DEFAULT NULL COMMENT 'описание' AFTER `jobTitle`, ADD `text` TEXT NULL DEFAULT NULL COMMENT 'описание' AFTER `description`;";
- $this->execute($sql);
- $sql = "ALTER TABLE `authors` ADD `show` INT UNSIGNED DEFAULT 0 COMMENT 'показывать страницу' AFTER `active`;COMMIT;";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "m230609_070938_author_ext cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "m230609_070938_author_ext cannot be reverted.\n";
- return false;
- }
- */
- }
|