| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M221105093726AddColumVoucherImgToQimallAddonsStoreCommission
- */
- class M221105093726QimallAddonsStoreCommissionCheck extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $table = 'qimall_addons_store_commission_check';
- $sql = "select * from information_schema.TABLES where TABLE_NAME = '{$table}';";
- $res = $this->db->createCommand($sql)->execute();
- if (!empty($res)) return '';
- $sql = "
- CREATE TABLE `qimall_addons_store_commission_check` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城id',
- `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
- `store_commission_id` int(11) NOT NULL DEFAULT '0' COMMENT '提成明细id',
- `order_no` varchar(100) NOT NULL DEFAULT '' COMMENT '订单编号',
- `voucher_img` varchar(255) not null default '' comment '凭证图片',
- `check_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '审核状态[0:待审核;1:已同意;2:已驳回]',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- `status` tinyint(1) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='门店提成明细审核记录表';
- ";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M221105093726AddColumVoucherImgToQimallAddonsStoreCommission cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M221105093726AddColumVoucherImgToQimallAddonsStoreCommission cannot be reverted.\n";
- return false;
- }
- */
- }
|