| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Exception;
- use yii\db\Migration;
- /**
- * Class M230203072720AddColumnIntoQimallAddonsStoreCate
- */
- class M230203072720AddColumnIntoQimallAddonsStoreCate extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql="ALTER TABLE qimall_addons_store_cate add is_collect_service_fee tinyint(1) not null default 0 comment '是否收取服务费:1是;0:否';";
- $this->execute($sql);
- $sql="ALTER TABLE qimall_addons_store_cate add collect_service_fee decimal(12,2) not null default 0 comment '服务费比例';";
- $this->execute($sql);
- }catch (Exception $e){
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230203072720AddColumnIntoQimallAddonsStoreCate cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230203072720AddColumnIntoQimallAddonsStoreCate cannot be reverted.\n";
- return false;
- }
- */
- }
|