Skip to content

Commit e03cede

Browse files
committed
refactor: updated the DateTime to have timezone
1 parent ea8d416 commit e03cede

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/event/tables.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from sqlalchemy.orm import Mapped, mapped_column
88

99
from database import Base
10-
import datetime
10+
from datetime import datetime, date
1111

1212
class EventDB(Base):
1313
__tablename__ = "event_info"
@@ -21,14 +21,14 @@ class EventDB(Base):
2121
nullable=True
2222
)
2323
name: Mapped[str] = mapped_column(String(64))
24-
start_time: Mapped[datetime.datetime] = mapped_column(DateTime)
25-
end_time: Mapped[datetime.datetime] = mapped_column(DateTime)
24+
start_time: Mapped[datetime] = mapped_column(DateTime(timezone=True))
25+
end_time: Mapped[datetime] = mapped_column(DateTime(timezone=True))
2626
repeat: Mapped[str] = mapped_column(String(64))
27-
start_date: Mapped[datetime.date] = mapped_column(
27+
start_date: Mapped[date] = mapped_column(
2828
Date,
2929
nullable=True
3030
)
31-
end_date: Mapped[datetime.date] = mapped_column(
31+
end_date: Mapped[date] = mapped_column(
3232
Date,
3333
nullable=True
3434
)

0 commit comments

Comments
 (0)