12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- use yii\db\Migration;
- /**
- * Class m230405_032449_comments
- */
- class m230405_032449_comments extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "ALTER TABLE `comments` ADD `parent_id` INT UNSIGNED NULL DEFAULT NULL AFTER `created_at`, ADD `likeed` INT NOT NULL DEFAULT '0' AFTER `parent_id`, ADD `fakename` VARCHAR(64) NULL DEFAULT NULL AFTER `likeed`, ADD INDEX `parent` (`parent_id`); COMMIT;";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "m230405_032449_comments cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "m230405_032449_comments cannot be reverted.\n";
- return false;
- }
- */
- }
|