fix(aihr): persist org hire dates
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
-- AIHR 组织快照入职日期迁移(MySQL 8.x)
|
||||
-- 仅补齐结构,不写入业务数据;可重复执行。
|
||||
SET @aihr_hire_date_exists := (
|
||||
SELECT COUNT(*)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'aihr_org_snapshot'
|
||||
AND COLUMN_NAME = 'hire_date'
|
||||
);
|
||||
SET @aihr_hire_date_ddl := IF(
|
||||
@aihr_hire_date_exists = 0,
|
||||
'ALTER TABLE aihr_org_snapshot ADD COLUMN `hire_date` date DEFAULT NULL COMMENT ''入职日期(用于新员工三个月资格判断)'' AFTER `employment_status`',
|
||||
'SELECT 1'
|
||||
);
|
||||
PREPARE aihr_hire_date_stmt FROM @aihr_hire_date_ddl;
|
||||
EXECUTE aihr_hire_date_stmt;
|
||||
DEALLOCATE PREPARE aihr_hire_date_stmt;
|
||||
Reference in New Issue
Block a user