Skip to content

Commit

Permalink
update the datetime for udpated_at and deleted_at
Browse files Browse the repository at this point in the history
  • Loading branch information
Mithun Thomas committed Dec 27, 2023
1 parent 314e816 commit eac5289
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/app/models/post.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Optional
import uuid as uuid_pkg
from datetime import datetime, UTC

Expand All @@ -23,6 +24,6 @@ class Post(Base):
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), default_factory=lambda: datetime.now(UTC)
)
updated_at: Mapped[datetime | None] = mapped_column(default=None)
deleted_at: Mapped[datetime | None] = mapped_column(default=None)
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), default=None)
deleted_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), default=None)
is_deleted: Mapped[bool] = mapped_column(default=False, index=True)
2 changes: 1 addition & 1 deletion src/app/models/rate_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class RateLimit(Base):
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), default_factory=lambda: datetime.now(UTC)
)
updated_at: Mapped[Optional[datetime]] = mapped_column(default=None)
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), default=None)
2 changes: 1 addition & 1 deletion src/app/models/tier.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class Tier(Base):
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), default_factory=lambda: datetime.now(UTC)
)
updated_at: Mapped[Optional[datetime]] = mapped_column(default=None)
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), default=None)
4 changes: 2 additions & 2 deletions src/app/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class User(Base):
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), default_factory=lambda: datetime.now(UTC)
)
updated_at: Mapped[Optional[datetime]] = mapped_column(default=None)
deleted_at: Mapped[Optional[datetime]] = mapped_column(default=None)
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), default=None)
deleted_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), default=None)
is_deleted: Mapped[bool] = mapped_column(default=False, index=True)
is_superuser: Mapped[bool] = mapped_column(default=False)

Expand Down

0 comments on commit eac5289

Please sign in to comment.