Files
shz-backend/sql/migration_outdoor_fair_attendee_user.test-executed.sql

19 lines
667 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 执行状态:测试环境已执行
-- 测试环境test
-- 测试执行时间2026-07-24 10:16:38 +0800
-- 正式环境:未执行
-- 户外招聘会签到记录关联移动端用户
-- 历史签到记录 user_id 保持为空,仍使用原有快照字段展示。
ALTER TABLE shz.cms_outdoor_fair_attendee
ADD COLUMN IF NOT EXISTS user_id BIGINT;
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.user_id IS '移动端用户ID';
DROP INDEX IF EXISTS shz.uk_cms_outdoor_fair_attendee_user;
CREATE UNIQUE INDEX uk_cms_outdoor_fair_attendee_user
ON shz.cms_outdoor_fair_attendee (fair_id, user_id)
WHERE user_id IS NOT NULL AND del_flag = '0';