| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250613145855AddAddonsStoreExtra
- */
- class M250613145855AddAddonsStoreExtra extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- ALTER TABLE `qimall_addons_store_goods_extra` ADD COLUMN `service_fee_setting` longtext COMMENT '服务费设置';
- INSERT INTO `qimall_addons_store_menu` (`title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES ('服务费设置', '0', 8, '', 0, 'store/client/setting/service-fee', '', 2, 0, 999, NULL, '', 1, 0, 0);
- CREATE TABLE `qimall_addons_store_service_ratio_log`
- (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0',
- `store_id` int(11) unsigned NOT NULL DEFAULT '0',
- `before_store_service_ratio` decimal(12, 2) NOT NULL DEFAULT '0.00' COMMENT '变动前门店服务费比例',
- `after_store_service_ratio` decimal(12, 2) NOT NULL DEFAULT '0.00' COMMENT '变动后门店服务费比例',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,1:启用 0:禁用 -1:删除',
- `created_at` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) unsigned DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='O2O门店服务费比例记录(独立后台)';
- ;
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250613145855AddAddonsStoreExtra cannot be reverted.\n";
- return false;
- }
- }
|