| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace addons\SmartForm\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230815084627SmartFormAddUserFormIdIndex
- */
- class M230815084627SmartFormAddUserFormIdIndex extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->execute("ALTER TABLE `qimall_addons_smart_form_sms_notice` ADD INDEX `user_form_id` (`user_form_id`);");
- $this->execute("ALTER TABLE `qimall_addons_smart_form_template_user_form` ADD COLUMN `is_ignore` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否忽略、忽略后可再次填写当前表单' AFTER `status`;");
- $this->execute("ALTER TABLE `qimall_addons_smart_form_template_user_form` ADD COLUMN `order_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '绑定所属订单' AFTER `is_ignore`, ADD INDEX `order_id` (`order_id`);");
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230815084627SmartFormAddUserFormIdIndex cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230815084627SmartFormAddUserFormIdIndex cannot be reverted.\n";
- return false;
- }
- */
- }
|