refactor gao module
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
RENAME TABLE `gao_registration_event` TO `gao_event`;
|
||||
|
||||
ALTER TABLE `gao_event`
|
||||
DROP KEY `idx_gao_registration_event_status`,
|
||||
ADD KEY `idx_gao_event_status` (`status`, `deleted_at`, `sort`, `created_at`);
|
||||
|
||||
RENAME TABLE `gao_registration_event_role_relation` TO `gao_event_role_relation`;
|
||||
|
||||
ALTER TABLE `gao_event_role_relation`
|
||||
DROP KEY `idx_gao_registration_event_role_relation_registration_event_id`,
|
||||
CHANGE COLUMN `registration_event_id` `event_id` VARCHAR(36) NOT NULL COMMENT '登记事件 ID',
|
||||
ADD KEY `idx_gao_event_role_relation_event_id` (`event_id`);
|
||||
|
||||
RENAME TABLE `gao_registration_event_record` TO `gao_event_record`;
|
||||
|
||||
ALTER TABLE `gao_event_record`
|
||||
DROP KEY `idx_gao_registration_event_record_customer_id`,
|
||||
DROP KEY `idx_gao_registration_event_record_registration_event_id`,
|
||||
DROP KEY `idx_gao_registration_event_record_registered_at`,
|
||||
CHANGE COLUMN `registration_event_id` `event_id` VARCHAR(36) NOT NULL COMMENT '登记事件 ID',
|
||||
ADD KEY `idx_gao_event_record_customer_id` (`customer_id`),
|
||||
ADD KEY `idx_gao_event_record_event_id` (`event_id`),
|
||||
ADD KEY `idx_gao_event_record_registered_at` (`registered_at`);
|
||||
|
||||
UPDATE `attachment`
|
||||
SET `biz_type` = 'GAO_EVENT_RECORD'
|
||||
WHERE `biz_type` = 'GAO_REGISTRATION_EVENT_RECORD';
|
||||
|
||||
UPDATE `permission`
|
||||
SET `code` = CASE `code`
|
||||
WHEN 'REGISTRATION_EVENT:CREATE' THEN 'EVENT:CREATE'
|
||||
WHEN 'REGISTRATION_EVENT:READ' THEN 'EVENT:READ'
|
||||
WHEN 'REGISTRATION_EVENT:UPDATE' THEN 'EVENT:UPDATE'
|
||||
WHEN 'REGISTRATION_EVENT:DELETE' THEN 'EVENT:DELETE'
|
||||
WHEN 'REGISTRATION_EVENT_RECORD:CREATE' THEN 'EVENT_RECORD:CREATE'
|
||||
WHEN 'REGISTRATION_EVENT_RECORD:READ' THEN 'EVENT_RECORD:READ'
|
||||
WHEN 'REGISTRATION_EVENT_RECORD:EXPORT' THEN 'EVENT_RECORD:EXPORT'
|
||||
WHEN 'REGISTRATION_EVENT_RECORD:UPDATE' THEN 'EVENT_RECORD:UPDATE'
|
||||
WHEN 'REGISTRATION_EVENT_RECORD:DELETE' THEN 'EVENT_RECORD:DELETE'
|
||||
ELSE `code`
|
||||
END
|
||||
WHERE
|
||||
`module_code` = 'GAO'
|
||||
AND `code` IN (
|
||||
'REGISTRATION_EVENT:CREATE',
|
||||
'REGISTRATION_EVENT:READ',
|
||||
'REGISTRATION_EVENT:UPDATE',
|
||||
'REGISTRATION_EVENT:DELETE',
|
||||
'REGISTRATION_EVENT_RECORD:CREATE',
|
||||
'REGISTRATION_EVENT_RECORD:READ',
|
||||
'REGISTRATION_EVENT_RECORD:EXPORT',
|
||||
'REGISTRATION_EVENT_RECORD:UPDATE',
|
||||
'REGISTRATION_EVENT_RECORD:DELETE'
|
||||
);
|
||||
Reference in New Issue
Block a user