Files
offerpie_job_cleaner/app/models/mysql/relations.py
T
2026-06-02 18:38:36 +08:00

31 lines
1.2 KiB
Python

"""MySQL: 关联表模型"""
from datetime import datetime
from sqlalchemy import BigInteger, DateTime, String
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import MysqlBase
class JobRegionRelation(MysqlBase):
"""岗位-地区关联表"""
__tablename__ = "bg_job_region_relation"
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, comment="主键ID(雪花)")
job_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="岗位ID")
region_code: Mapped[str] = mapped_column(String(20), nullable=False, comment="地区编码")
create_time: Mapped[datetime] = mapped_column(DateTime, nullable=False, comment="创建时间")
class JobSkillTagRelation(MysqlBase):
"""岗位-技能标签关联表"""
__tablename__ = "bg_job_skill_tag_relation"
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, comment="主键ID(雪花)")
job_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="岗位ID")
skill_tag_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="技能标签ID")
create_time: Mapped[datetime] = mapped_column(DateTime, nullable=False, comment="创建时间")