Initial Commit
This commit is contained in:
21
api/app/models/common/core/timestamps.py
Normal file
21
api/app/models/common/core/timestamps.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from datetime import datetime
|
||||
from sqlalchemy import Column, String, Integer, DateTime
|
||||
|
||||
from models.common.base import BaseModel
|
||||
|
||||
|
||||
class timestamp(BaseModel):
|
||||
"""
|
||||
description: Timestamps.
|
||||
"""
|
||||
__tablename__ = "tcc_timestamps"
|
||||
_s_collection_name = "timestamps"
|
||||
_s_class_name = "timestamps"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True, index=True)
|
||||
name = Column(String(64), unique=True, nullable=False)
|
||||
timestamp = Column(
|
||||
DateTime,
|
||||
default=datetime.utcnow,
|
||||
onupdate=datetime.utcnow
|
||||
)
|
||||
Reference in New Issue
Block a user