-- 招聘会报名表 (PostgreSQL)
DROP TABLE IF EXISTS rc_job_fair_sign_up;
CREATE TABLE rc_job_fair_sign_up (
  id BIGSERIAL PRIMARY KEY,
  job_fair_id BIGINT NOT NULL,
  user_id BIGINT NOT NULL,
  sign_up_time TIMESTAMP,
  status CHAR(1) DEFAULT '0',
  del_flag CHAR(1) DEFAULT '0',
  create_by VARCHAR(64) DEFAULT '',
  create_time TIMESTAMP,
  update_by VARCHAR(64) DEFAULT '',
  update_time TIMESTAMP,
  remark VARCHAR(500)
);

COMMENT ON TABLE rc_job_fair_sign_up IS '招聘会报名表';
COMMENT ON COLUMN rc_job_fair_sign_up.id IS '主键ID';
COMMENT ON COLUMN rc_job_fair_sign_up.job_fair_id IS '招聘会ID';
COMMENT ON COLUMN rc_job_fair_sign_up.user_id IS '用户ID';
COMMENT ON COLUMN rc_job_fair_sign_up.sign_up_time IS '报名时间';
COMMENT ON COLUMN rc_job_fair_sign_up.status IS '状态 0正常 1已取消';
COMMENT ON COLUMN rc_job_fair_sign_up.del_flag IS '删除标志 0正常 2删除';
COMMENT ON COLUMN rc_job_fair_sign_up.create_by IS '创建者';
COMMENT ON COLUMN rc_job_fair_sign_up.create_time IS '创建时间';
COMMENT ON COLUMN rc_job_fair_sign_up.update_by IS '更新者';
COMMENT ON COLUMN rc_job_fair_sign_up.update_time IS '更新时间';
COMMENT ON COLUMN rc_job_fair_sign_up.remark IS '备注';

CREATE INDEX idx_job_fair_sign_up_fair_id ON rc_job_fair_sign_up(job_fair_id);
CREATE INDEX idx_job_fair_sign_up_user_id ON rc_job_fair_sign_up(user_id);
CREATE UNIQUE INDEX uk_fair_user ON rc_job_fair_sign_up(job_fair_id, user_id);
