mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-26 14:23:52 +00:00
* Refactor physical deletion to logical deletion * Update the usage of unique indexes * Update scheduler update and delete * Fix lint * Add some missing logic * Optimize codegen get by id
20 lines
579 B
Python
20 lines
579 B
Python
import sqlalchemy as sa
|
|
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from backend.common.model import Base, id_key
|
|
|
|
|
|
class DataScope(Base):
|
|
"""数据范围表"""
|
|
|
|
__tablename__ = 'sys_data_scope'
|
|
__table_args__ = (
|
|
sa.UniqueConstraint('name', 'deleted', name='uk_sys_data_scope_name_deleted'),
|
|
{'comment': '数据范围表'},
|
|
)
|
|
|
|
id: Mapped[id_key] = mapped_column(init=False)
|
|
name: Mapped[str] = mapped_column(sa.String(64), comment='名称')
|
|
status: Mapped[int] = mapped_column(default=1, comment='状态(0停用 1正常)')
|