oak-pay-business/upgrade/3.0.0/01.sql

227 lines
11 KiB
SQL

-- abstactPayProduct
CREATE TABLE `abstactPayProduct` (
`taxLossRatio` decimal(4, 2) NULL DEFAULT NULL,
`refundGapDays` int(0) NULL DEFAULT NULL,
`refundCompensateRatio` int(0) NULL DEFAULT NULL,
`needReceiving` tinyint(1) NULL DEFAULT NULL,
`applicationId` char(36) NOT NULL,
`enabled` tinyint(1) NOT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `abstactPayProduct_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `abstactPayProduct_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `abstactPayProduct_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
INDEX `abstactPayProduct_fk_applicationId_auto_create`(`applicationId`, `$$deleteAt$$`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
RENAME TABLE abstactPayProduct TO abstractPayProduct;
-- abstractPayAccount
RENAME TABLE abstractAccount TO abstractPayAccount;
ALTER TABLE `abstractPayAccount` MODIFY `taxLossRatio` decimal(4, 2) DEFAULT NULL;
ALTER TABLE `abstractPayAccount` ADD `price` bigint(0) NOT NULL;
ALTER TABLE `abstractPayAccount` ADD `needReceiving` tinyint(1) DEFAULT NULL;
ALTER TABLE `abstractPayAccount` ADD `systemId` char(36) NOT NULL;
-- abstractShipAccount
CREATE TABLE `abstractShipAccount` (
`sort` decimal(12, 8) NOT NULL,
`phatom1` bigint(0) NULL DEFAULT NULL,
`phatom2` varchar(64) NULL DEFAULT NULL,
`systemId` char(36) NOT NULL,
`disabled` tinyint(1) NOT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `abstractShipAccount_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `abstractShipAccount_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `abstractShipAccount_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
INDEX `abstractShipAccount_fk_systemId_auto_create`(`systemId`, `$$deleteAt$$`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- deposit
ALTER TABLE `deposit` ADD `shipId` char(36) DEFAULT NULL;
-- offlineAccount
ALTER TABLE `offlineAccount` ADD `needReceiving` tinyint(1) DEFAULT NULL;
-- order
ALTER TABLE `order` ADD `addressId` char(36) DEFAULT NULL;
ALTER TABLE `order` ADD `payAt` bigint(0) DEFAULT NULL;
-- pay
ALTER TABLE `pay` ADD `phantom5` json NULL;
ALTER TABLE `pay` ADD `autoStart` tinyint(1) DEFAULT NULL;
-- ship
CREATE TABLE `ship` (
`type` enum('virtual','pickup','express') NOT NULL,
`shipServiceId` char(36) NULL DEFAULT NULL,
`toId` char(36) NULL DEFAULT NULL,
`fromId` char(36) NULL DEFAULT NULL,
`entity` varchar(32) NULL DEFAULT NULL,
`entityId` varchar(64) NULL DEFAULT NULL,
`phantom1` varchar(32) NULL DEFAULT NULL,
`phantom2` varchar(32) NULL DEFAULT NULL,
`phantom3` int(0) NULL DEFAULT NULL,
`phantom4` bigint(0) NULL DEFAULT NULL,
`phantom5` json NULL,
`extraShipId` varchar(128) NULL DEFAULT NULL,
`extraPaths` json NULL,
`receiveAt` bigint(0) NULL DEFAULT NULL,
`cargoBoxId` char(36) NULL DEFAULT NULL,
`iState` enum('cancelled','unshipped','shipping','received','rejected','unknown','receiving') NULL DEFAULT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `index_phantom1`(`phantom1`, `$$deleteAt$$`) USING BTREE,
INDEX `index_phantom3`(`phantom3`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_fk_shipServiceId_auto_create`(`shipServiceId`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_fk_toId_auto_create`(`toId`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_fk_fromId_auto_create`(`fromId`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_fk_entity_entityId_auto_create`(`entity`, `entityId`, `$$deleteAt$$`) USING BTREE,
INDEX `ship_fk_cargoBoxId_auto_create`(`cargoBoxId`, `$$deleteAt$$`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- shipCompany
CREATE TABLE `shipCompany` (
`name` varchar(64) NOT NULL,
`abbr` varchar(32) NOT NULL,
`wechatMpName` varchar(32) NULL DEFAULT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `shipCompany_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipCompany_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipCompany_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
FULLTEXT INDEX `index_name`(`name`) WITH PARSER `ngram`
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- shipOrder
CREATE TABLE `shipOrder` (
`shipId` char(36) NOT NULL,
`orderId` char(36) NOT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `shipOrder_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipOrder_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipOrder_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipOrder_fk_shipId_auto_create`(`shipId`, `$$deleteAt$$`) USING BTREE,
INDEX `shipOrder_fk_orderId_auto_create`(`orderId`, `$$deleteAt$$`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- shipService
CREATE TABLE `shipService` (
`name` varchar(32) NOT NULL,
`shipCompanyId` char(36) NOT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `shipService_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipService_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipService_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipService_fk_shipCompanyId_auto_create`(`shipCompanyId`, `$$deleteAt$$`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- shipServiceSystem
CREATE TABLE `shipServiceSystem` (
`shipServiceId` char(36) NOT NULL,
`systemId` char(36) NOT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `shipServiceSystem_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipServiceSystem_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipServiceSystem_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
INDEX `shipServiceSystem_fk_shipServiceId_auto_create`(`shipServiceId`, `$$deleteAt$$`) USING BTREE,
INDEX `shipServiceSystem_fk_systemId_auto_create`(`systemId`, `$$deleteAt$$`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- wechatMpShip
CREATE TABLE `wechatMpShip` (
`sort` decimal(12, 8) NOT NULL,
`phatom1` bigint(0) NULL DEFAULT NULL,
`phatom2` varchar(64) NULL DEFAULT NULL,
`systemId` char(36) NOT NULL,
`disabled` tinyint(1) NOT NULL,
`applicationId` char(36) NOT NULL,
`id` char(36) NOT NULL,
`$$seq$$` bigint(0) NOT NULL AUTO_INCREMENT,
`$$createAt$$` bigint(0) NOT NULL,
`$$updateAt$$` bigint(0) NOT NULL,
`$$deleteAt$$` bigint(0) NULL DEFAULT NULL,
`$$triggerData$$` json NULL,
`$$triggerUuid$$` char(36) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `$$seq$$`(`$$seq$$`) USING BTREE,
INDEX `wechatMpShip_create_at_auto_create`(`$$createAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `wechatMpShip_update_at_auto_create`(`$$updateAt$$`, `$$deleteAt$$`) USING BTREE,
INDEX `wechatMpShip_trigger_uuid`(`$$triggerUuid$$`, `$$deleteAt$$`) USING BTREE,
INDEX `wechatMpShip_fk_systemId_auto_create`(`systemId`, `$$deleteAt$$`) USING BTREE,
INDEX `wechatMpShip_fk_applicationId_auto_create`(`applicationId`, `$$deleteAt$$`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- wpAccount
ALTER TABLE `wpAccount` ADD `needReceiving` tinyint(1) NULL DEFAULT NULL;
-- wpProduct
ALTER TABLE `wpProduct` ADD `needReceiving` tinyint(1) NULL DEFAULT NULL;
ALTER TABLE `wpProduct` ADD `refundCompensateRatio` int(0) DEFAULT NULL;
ALTER TABLE `wpProduct` ADD `refundGapDays` int(0) DEFAULT NULL;
-- path data
INSERT INTO `path`(`destEntity`, `value`, `recursive`, `sourceEntity`, `desc`, `id`, `$$createAt$$`, `$$updateAt$$`, `$$deleteAt$$`, `$$triggerData$$`, `$$triggerUuid$$`) VALUES ('ship', 'deposit$ship.account.user', 0, 'user', NULL, 'user-deposit-ship', 1744696238413, 1744696238413, NULL, NULL, NULL);
INSERT INTO `path`(`destEntity`, `value`, `recursive`, `sourceEntity`, `desc`, `id`, `$$createAt$$`, `$$updateAt$$`, `$$deleteAt$$`, `$$triggerData$$`, `$$triggerUuid$$`) VALUES ('ship', 'deposit$ship.creator', 0, 'user', NULL, 'creator-deposit-ship', 1744696238413, 1744696238413, NULL, NULL, NULL);
-- actionAuth data
INSERT INTO `actionAuth`(`relationId`, `pathId`, `deActions`, `id`, `$$createAt$$`, `$$updateAt$$`, `$$deleteAt$$`, `$$triggerData$$`, `$$triggerUuid$$`) VALUES (NULL, 'user-deposit-ship', '[\"select\", \"succeedReceiving\", \"reject\"]', 'user-deposit-ship', 1744696238400, 1744696238400, NULL, NULL, NULL);
INSERT INTO `actionAuth`(`relationId`, `pathId`, `deActions`, `id`, `$$createAt$$`, `$$updateAt$$`, `$$deleteAt$$`, `$$triggerData$$`, `$$triggerUuid$$`) VALUES (NULL, 'creator-deposit-ship', '[\"select\", \"succeedReceiving\", \"reject\"]', 'creator-deposit-ship', 1744696238400, 1744696238400, NULL, NULL, NULL);