| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240531111423AddSortTablePoster
- */
- class M240531111423AddSortTablePoster extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = <<<SQL
- ALTER TABLE `qimall_poster` ADD COLUMN `sort` int(10) NOT NULL DEFAULT 0 COMMENT '排序' AFTER `scan_code_num`;
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240531111423AddSortTablePoster cannot be reverted.\n";
- return false;
- }
- }
|