You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
558 B
Python
18 lines
558 B
Python
from sqlalchemy import DateTime
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from sqlalchemy.sql import func
|
|
|
|
from admin_app.db.database import AdminBase
|
|
|
|
|
|
# Base abstrata com timestamps para futuras entidades administrativas.
|
|
class AdminTimestampedModel(AdminBase):
|
|
__abstract__ = True
|
|
|
|
created_at: Mapped[object] = mapped_column(DateTime, server_default=func.current_timestamp())
|
|
updated_at: Mapped[object] = mapped_column(
|
|
DateTime,
|
|
server_default=func.current_timestamp(),
|
|
onupdate=func.current_timestamp(),
|
|
)
|