Switched to timezone aware schema for database

This commit is contained in:
Jonas Linter
2025-10-17 22:38:57 +02:00
parent bd54fc72ad
commit 27ed8dcd1f
3 changed files with 74 additions and 11 deletions

View File

@@ -97,7 +97,7 @@ class HashedCustomer(Base):
hashed_country_code = Column(String(64))
hashed_gender = Column(String(64))
hashed_birth_date = Column(String(64))
created_at = Column(DateTime)
created_at = Column(DateTime(timezone=True))
customer = relationship("Customer", backref="hashed_version")
@@ -114,7 +114,7 @@ class Reservation(Base):
num_children = Column(Integer)
children_ages = Column(String) # comma-separated
offer = Column(String)
created_at = Column(DateTime)
created_at = Column(DateTime(timezone=True))
# Add all UTM fields and user comment for XML
utm_source = Column(String)
utm_medium = Column(String)
@@ -142,4 +142,4 @@ class AckedRequest(Base):
unique_id = Column(
String, index=True
) # Should match Reservation.form_id or another unique field
timestamp = Column(DateTime)
timestamp = Column(DateTime(timezone=True))