mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-17 13:54:14 +08:00
Update unique columns in dict models (#577)
This commit is contained in:
@ -22,7 +22,7 @@ class DictData(Base):
|
|||||||
|
|
||||||
id: Mapped[id_key] = mapped_column(init=False)
|
id: Mapped[id_key] = mapped_column(init=False)
|
||||||
label: Mapped[str] = mapped_column(String(32), unique=True, comment='字典标签')
|
label: Mapped[str] = mapped_column(String(32), unique=True, comment='字典标签')
|
||||||
value: Mapped[str] = mapped_column(String(32), unique=True, comment='字典值')
|
value: Mapped[str] = mapped_column(String(32), comment='字典值')
|
||||||
sort: Mapped[int] = mapped_column(default=0, comment='排序')
|
sort: Mapped[int] = mapped_column(default=0, comment='排序')
|
||||||
status: Mapped[int] = mapped_column(default=1, comment='状态(0停用 1正常)')
|
status: Mapped[int] = mapped_column(default=1, comment='状态(0停用 1正常)')
|
||||||
remark: Mapped[str | None] = mapped_column(
|
remark: Mapped[str | None] = mapped_column(
|
||||||
|
@ -21,7 +21,7 @@ class DictType(Base):
|
|||||||
__tablename__ = 'sys_dict_type'
|
__tablename__ = 'sys_dict_type'
|
||||||
|
|
||||||
id: Mapped[id_key] = mapped_column(init=False)
|
id: Mapped[id_key] = mapped_column(init=False)
|
||||||
name: Mapped[str] = mapped_column(String(32), unique=True, comment='字典类型名称')
|
name: Mapped[str] = mapped_column(String(32), comment='字典类型名称')
|
||||||
code: Mapped[str] = mapped_column(String(32), unique=True, comment='字典类型编码')
|
code: Mapped[str] = mapped_column(String(32), unique=True, comment='字典类型编码')
|
||||||
status: Mapped[int] = mapped_column(default=1, comment='状态(0停用 1正常)')
|
status: Mapped[int] = mapped_column(default=1, comment='状态(0停用 1正常)')
|
||||||
remark: Mapped[str | None] = mapped_column(
|
remark: Mapped[str | None] = mapped_column(
|
||||||
|
Reference in New Issue
Block a user