17 lines
434 B
Python
17 lines
434 B
Python
"""
|
|
Base model module.
|
|
"""
|
|
from datetime import datetime
|
|
from sqlalchemy import Column, DateTime, Integer
|
|
from app.db.database import Base
|
|
|
|
|
|
class BaseModel(Base):
|
|
"""
|
|
Base model for all models.
|
|
"""
|
|
__abstract__ = True
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) |