added column docstring

This commit is contained in:
Viet Than 2023-08-23 00:09:02 -04:00
parent 110b3ed963
commit e32f24a020
2 changed files with 3 additions and 0 deletions

View file

@ -72,6 +72,8 @@ class CreatedDateTimeBase(Base):
Declare default column for classes/tables inheriting `CreatedDateTimeBase`.
Retrieving `created_datetimez` will return a `datetime` object with `tzinfo` for UTC.
New rows have a default created_datetimez of the database server's `now()`
"""
return Column(DateTime(timezone=True), nullable=False, server_default=now())

View file

@ -21,6 +21,7 @@ class VolunteerJanitorRecord(Base):
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
comment_id = Column(Integer, ForeignKey("comments.id"), nullable=False)
recorded_datetimez = Column(DateTime(timezone=True), default=0, nullable=False, server_default=now())
"""new rows have a default recorded_datetimez of the database server's `now()`"""
result = Column(Enum(VolunteerJanitorResult), default=VolunteerJanitorResult.Pending, nullable=False)
Index('volunteer_comment_index', user_id, comment_id)