Files
autoAiWorkSys/_sql/update_pla_account_job_postings_fields.sql
张成 5d7444cd65 1
2025-11-24 13:23:42 +08:00

47 lines
1.8 KiB
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.
-- 根据 model 定义更新 pla_account 和 job_postings 表的字段
-- 执行时间: 2025-01-20
-- ============================================
-- 更新 pla_account 表
-- ============================================
-- 添加 is_salary_priority 字段排序优先级JSON类型
ALTER TABLE pla_account
ADD COLUMN is_salary_priority JSON COMMENT '排序优先级' AFTER job_type_id;
-- 添加 user_address 字段(用户地址)
ALTER TABLE pla_account
ADD COLUMN user_address VARCHAR(200) NOT NULL DEFAULT '' COMMENT '用户地址' AFTER is_salary_priority;
-- 添加 user_longitude 字段(用户经度)
ALTER TABLE pla_account
ADD COLUMN user_longitude VARCHAR(50) NOT NULL DEFAULT '' COMMENT '用户经度' AFTER user_address;
-- 添加 user_latitude 字段(用户纬度)
ALTER TABLE pla_account
ADD COLUMN user_latitude VARCHAR(50) NOT NULL DEFAULT '' COMMENT '用户纬度' AFTER user_longitude;
-- 添加 is_chat_outsourcing 字段(是否沟通外包岗位)
ALTER TABLE pla_account
ADD COLUMN is_chat_outsourcing TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否沟通外包岗位' AFTER auto_active;
-- ============================================
-- 更新 job_postings 表
-- ============================================
-- 添加 longitude 字段(经度)
ALTER TABLE job_postings
ADD COLUMN longitude VARCHAR(50) DEFAULT '' COMMENT '经度' AFTER location;
-- 添加 latitude 字段(纬度)
ALTER TABLE job_postings
ADD COLUMN latitude VARCHAR(50) DEFAULT '' COMMENT '纬度' AFTER longitude;
-- ============================================
-- 说明
-- ============================================
-- 如果字段已存在,执行 ALTER TABLE 会报错,可以忽略
-- 如果 MySQL 版本低于 5.7is_salary_priority 字段的 JSON 类型需要改为 TEXT 类型
-- 执行前建议先备份数据库