| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240704091330AttachmentTableAddStoreIdField
- */
- class M240704091330AttachmentTableAddStoreIdField extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- ALTER TABLE `qimall_attachment`
- ADD COLUMN `store_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '门店ID' AFTER `mch_id`;
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240704091330AttachmentTableAddStoreIdField cannot be reverted.\n";
- return false;
- }
- */
- }
|