first commit

This commit is contained in:
huangjufei
2026-11-12 14:34:17 +08:00
commit 10c2553e04
674 changed files with 76608 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
-- 仅当你已经执行过“hr_employee 为独立 employee_id 主键”的旧版 hrm_v1.sql 时执行。
-- 如果执行的是当前最新版 hrm_v1.sql,请不要执行本文件。
RENAME TABLE hr_employee TO hr_employee_profile;
ALTER TABLE hr_employee_profile
DROP PRIMARY KEY,
DROP COLUMN employee_id,
DROP INDEX uk_hr_employee_user,
DROP INDEX idx_hr_employee_leader,
ADD PRIMARY KEY (user_id),
CHANGE direct_leader_employee_id direct_leader_user_id bigint NOT NULL,
ADD KEY idx_hr_employee_leader (direct_leader_user_id);
ALTER TABLE hr_employee_change_log
CHANGE employee_id user_id bigint NOT NULL,
DROP INDEX idx_hr_employee_log,
ADD KEY idx_hr_employee_log (user_id,create_time);
ALTER TABLE hr_resignation
DROP INDEX uk_hr_resignation_employee_open,
CHANGE employee_id user_id bigint NOT NULL,
ADD UNIQUE KEY uk_hr_resignation_employee_open (user_id,status);
ALTER TABLE hr_employee_qualification
CHANGE employee_id user_id bigint NOT NULL,
DROP INDEX idx_hr_qualification_employee,
ADD KEY idx_hr_qualification_employee (user_id);
ALTER TABLE hr_monthly_performance
DROP INDEX uk_hr_monthly_performance,
DROP INDEX idx_hr_performance_leader,
CHANGE employee_id user_id bigint NOT NULL,
CHANGE leader_employee_id leader_user_id bigint NOT NULL,
ADD UNIQUE KEY uk_hr_monthly_performance (performance_month,user_id),
ADD KEY idx_hr_performance_leader (leader_user_id,performance_month,status);