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

41 lines
1.6 KiB
PL/PgSQL
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-30 10:06:47 +0800
-- 正式环境:未执行
-- 石河子智慧就业:人才服务岗位推送关联表。
-- 关联岗位 ID 与身份证号is_push=0 表示未推送is_push=1 表示已推送。
-- 可重复执行,不写入业务测试数据。
BEGIN;
SET LOCAL search_path = shz, public;
CREATE SEQUENCE IF NOT EXISTS job_push_record_id_seq
START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
CREATE TABLE IF NOT EXISTS job_push_record (
id BIGINT NOT NULL DEFAULT nextval('job_push_record_id_seq') PRIMARY KEY,
job_id BIGINT NOT NULL,
id_number VARCHAR(32) NOT NULL,
is_push SMALLINT NOT NULL DEFAULT 0,
push_time TIMESTAMP(0),
create_time TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_time TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
remark VARCHAR(500)
);
COMMENT ON TABLE job_push_record IS '人才服务岗位推送关联表';
COMMENT ON COLUMN job_push_record.job_id IS '石河子岗位 ID关联 job.job_id';
COMMENT ON COLUMN job_push_record.id_number IS '被推送人的身份证号';
COMMENT ON COLUMN job_push_record.is_push IS '是否已推送0未推送1已推送';
COMMENT ON COLUMN job_push_record.push_time IS '最近一次推送时间';
CREATE UNIQUE INDEX IF NOT EXISTS uk_job_push_record_job_id_number
ON job_push_record (job_id, id_number);
CREATE INDEX IF NOT EXISTS idx_job_push_record_id_number
ON job_push_record (id_number);
CREATE INDEX IF NOT EXISTS idx_job_push_record_is_push
ON job_push_record (is_push);
COMMIT;