refactor(todo): 移除 due_at 字段,改用 order 字段管理象限内顺序
This commit is contained in:
@@ -26,7 +26,7 @@ class TodoPriority(int, Enum):
|
||||
|
||||
class Todo(TimestampMixin, SoftDeleteMixin, Base):
|
||||
__tablename__: str = "todos"
|
||||
__table_args__ = {"extend_existing": True}
|
||||
__table_args__: dict[str, bool] = {"extend_existing": True}
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(
|
||||
UUID(as_uuid=True), primary_key=True, default=uuid.uuid4
|
||||
@@ -43,9 +43,10 @@ class Todo(TimestampMixin, SoftDeleteMixin, Base):
|
||||
String(1000),
|
||||
nullable=True,
|
||||
)
|
||||
due_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True),
|
||||
nullable=True,
|
||||
order: Mapped[int] = mapped_column(
|
||||
Integer,
|
||||
nullable=False,
|
||||
default=0,
|
||||
)
|
||||
priority: Mapped[int] = mapped_column(
|
||||
Integer,
|
||||
|
||||
Reference in New Issue
Block a user