oil-station/fuintBackend/db/update_for_v3.0.7.sql

140 lines
6.0 KiB
MySQL
Raw Normal View History

2024-08-16 18:26:19 +08:00
ALTER TABLE `mt_merchant`
ADD COLUMN `TYPE` VARCHAR (30) DEFAULT '' NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>restaurant<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>retail<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۣ<EFBFBD>service<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>other<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AFTER `ID`;
ALTER TABLE `mt_coupon`
ADD COLUMN `EXPIRE_TYPE` VARCHAR (30) DEFAULT '' NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AFTER `USE_FOR`,
ADD COLUMN `EXPIRE_TIME` INT (10) DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD>Ч<EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AFTER `EXPIRE_TYPE`;
ALTER TABLE `mt_merchant`
ADD COLUMN `WX_APP_ID` VARCHAR (50) DEFAULT '' NULL COMMENT '΢<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>appId' AFTER `ADDRESS`,
ADD COLUMN `WX_APP_SECRET` VARCHAR (50) DEFAULT '' NULL COMMENT '΢<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ' AFTER `WX_APP_ID`,
ADD COLUMN `WX_OFFICIAL_APP_ID` VARCHAR (50) DEFAULT '' NULL COMMENT '΢<EFBFBD>Ź<EFBFBD><EFBFBD>ں<EFBFBD>appId' AFTER `WX_APP_SECRET`,
ADD COLUMN `WX_OFFICIAL_APP_SECRET` VARCHAR (50) DEFAULT '' NULL COMMENT '΢<EFBFBD>Ź<EFBFBD><EFBFBD>ں<EFBFBD><EFBFBD><EFBFBD>Կ' AFTER `WX_OFFICIAL_APP_ID`;
ALTER TABLE `mt_message`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`;
ALTER TABLE `mt_article`
CHANGE `STORE_ID` `STORE_ID` INT DEFAULT 0 NOT NULL COMMENT 'Ŀ¼ID' AFTER `ID`,
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `STORE_ID`;
ALTER TABLE `mt_balance`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `ID`;
ALTER TABLE `mt_banner`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `TITLE`;
ALTER TABLE `mt_book`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
CHANGE `STORE_ID` `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID',
CHANGE `GOODS_ID` `GOODS_ID` INT DEFAULT 0 NULL COMMENT 'ԤԼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID';
ALTER TABLE `mt_book_item`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
CHANGE `STORE_ID` `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID',
CHANGE `GOODS_ID` `GOODS_ID` INT DEFAULT 0 NULL COMMENT 'ԤԼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID';
ALTER TABLE `mt_cart`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `USER_ID`;
ALTER TABLE `mt_coupon`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
ADD COLUMN `STORE_ID` INT DEFAULT 0 COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `MERCHANT_ID`;
ALTER TABLE `mt_coupon_group`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
ADD COLUMN `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `MERCHANT_ID`;
ALTER TABLE `mt_freight`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
ADD COLUMN `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `MERCHANT_ID`;
ALTER TABLE `mt_give`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `USER_ID`;
ALTER TABLE `mt_goods`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `TYPE`;
ALTER TABLE `mt_goods_cate`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>' AFTER `ID`;
ALTER TABLE `mt_open_gift`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`;
ALTER TABLE `mt_order`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `COUPON_ID`;
ALTER TABLE `mt_point`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
CHANGE `STORE_ID` `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID';
ALTER TABLE `mt_refund`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `ORDER_ID`;
ALTER TABLE `mt_send_log`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
ADD COLUMN `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `MERCHANT_ID`;
ALTER TABLE `mt_setting`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
ADD COLUMN `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `MERCHANT_ID`;
ALTER TABLE `mt_sms_sended_log`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `LOG_ID`,
ADD COLUMN `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `MERCHANT_ID`;
ALTER TABLE `mt_sms_template`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
ADD COLUMN `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `MERCHANT_ID`;
ALTER TABLE `mt_staff`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`,
CHANGE `STORE_ID` `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID';
ALTER TABLE `mt_user`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD>ID' AFTER `ADDRESS`,
CHANGE `STORE_ID` `STORE_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID';
ALTER TABLE `mt_user_action`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `USER_ID`;
ALTER TABLE `mt_user_coupon`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `USER_ID`,
CHANGE `STORE_ID` `STORE_ID` INT DEFAULT 0 NULL COMMENT 'ʹ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD>ID';
ALTER TABLE `mt_user_grade`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`;
ALTER TABLE `mt_confirm_log`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `OPERATOR_USER_ID`;
ALTER TABLE `mt_stock`
ADD COLUMN `MERCHANT_ID` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `ID`;
ALTER TABLE `t_duty`
ADD COLUMN `merchant_id` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' FIRST;
ALTER TABLE `t_source`
ADD COLUMN `merchant_id` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' FIRST;
ALTER TABLE `t_action_log`
ADD COLUMN `merchant_id` INT DEFAULT 0 NULL COMMENT '<EFBFBD>̻<EFBFBD>ID' AFTER `id`,
ADD COLUMN `store_id` INT DEFAULT 0 NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID' AFTER `merchant_id`;
UPDATE `mt_coupon` SET MERCHANT_ID = '1', STORE_ID = '1';
UPDATE `mt_coupon_group` SET MERCHANT_ID = '1', STORE_ID = '1';
UPDATE `mt_give` SET MERCHANT_ID = '1', STORE_ID = '1';
UPDATE `mt_goods` SET MERCHANT_ID = '1';
UPDATE `mt_goods_cate` SET MERCHANT_ID = '1';
UPDATE `mt_open_gift` SET MERCHANT_ID = '1';
UPDATE `mt_order` SET MERCHANT_ID = '1';
UPDATE `mt_refund` SET MERCHANT_ID = '1';
UPDATE `mt_setting` SET MERCHANT_ID = '1';
UPDATE `mt_sms_template` SET MERCHANT_ID = '1';
UPDATE `mt_staff` SET MERCHANT_ID = '1';
UPDATE `mt_user` SET MERCHANT_ID = '1';
UPDATE `mt_user_action` SET MERCHANT_ID = '1';
UPDATE `mt_user_coupon` SET MERCHANT_ID = '1';
UPDATE `mt_user_grade` SET MERCHANT_ID = '1';
UPDATE `t_duty` SET merchant_id = '1';
UPDATE `t_source` SET merchant_id = '1';