Update atst to atat
This commit is contained in:
13
atat/models/mixins/timestamps.py
Normal file
13
atat/models/mixins/timestamps.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from sqlalchemy import Column, func, TIMESTAMP
|
||||
|
||||
|
||||
class TimestampsMixin(object):
|
||||
time_created = Column(
|
||||
TIMESTAMP(timezone=True), nullable=False, server_default=func.now()
|
||||
)
|
||||
time_updated = Column(
|
||||
TIMESTAMP(timezone=True),
|
||||
nullable=False,
|
||||
server_default=func.now(),
|
||||
onupdate=func.current_timestamp(),
|
||||
)
|
Reference in New Issue
Block a user