These timestamps need to be required.

This commit is contained in:
Yaro Kasear 2025-09-05 15:18:28 -05:00
parent 4ebc82c08b
commit 60708164fa

View file

@ -6,8 +6,8 @@ Base = declarative_base()
@declarative_mixin @declarative_mixin
class CRUDMixin: class CRUDMixin:
id = Column(Integer, primary_key=True) id = Column(Integer, primary_key=True)
created_at = Column(DateTime, default=func.now()) created_at = Column(DateTime, default=func.now(), nullable=False)
updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) updated_at = Column(DateTime, default=func.now(), nullable=False, onupdate=func.now())
def as_dict(self): def as_dict(self):
# Combine all columns from all inherited tables # Combine all columns from all inherited tables