22 lines
972 B
Python
22 lines
972 B
Python
"""技能标签模型"""
|
|
from .base import Base
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
from sqlalchemy import BigInteger, VARCHAR, Boolean, Integer, Text
|
|
from typing import List, Optional
|
|
|
|
|
|
class SkillTag(Base):
|
|
__tablename__ = "skill_tags"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
name: Mapped[str] = mapped_column(VARCHAR(255), nullable=False)
|
|
slug: Mapped[str] = mapped_column(VARCHAR(80), nullable=False, index=True)
|
|
category: Mapped[str] = mapped_column(VARCHAR(100), nullable=False)
|
|
description: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
|
|
is_system: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
|
sort_order: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
|
|
|
|
user_bindings: Mapped[List["UserSkillBinding"]] = relationship(
|
|
"UserSkillBinding", back_populates="skill_tag", cascade="all, delete-orphan"
|
|
)
|