Files
fastapi-best-architecture/backend/app/admin/model/data_scope.py
T
Wu Clan a5e9a0e805 Refactor physical deletion to logical deletion (#1191)
* 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
2026-05-30 15:02:00 +08:00

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正常)')