| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230206065257AddCommunityToOrder
- */
- class M230206065257AddCommunityToOrder extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = "ALTER TABLE `qimall_order` ADD COLUMN `community` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '小区ID' AFTER `town`;
- ALTER TABLE `qimall_user_address`
- ADD COLUMN `community_id` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT '小区ID' AFTER `town`,
- ADD COLUMN `community` VARCHAR(255) NULL DEFAULT NULL COMMENT '小区名称' AFTER `community_id`;";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230206065257AddCommunityToOrder cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230206065257AddCommunityToOrder cannot be reverted.\n";
- return false;
- }
- */
- }
|