migrate from supabase to postgres

This commit is contained in:
2025-09-09 16:01:58 +07:00
parent a836ebb2a6
commit aa62667d89
21 changed files with 327 additions and 902 deletions
+12
View File
@@ -0,0 +1,12 @@
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime, BigInteger
from sqlalchemy.sql import func
from datetime import datetime
# Tạo Base class cho tất cả ORM models
Base = declarative_base()
class TimestampMixin:
"""Mixin để tự động thêm created_at và updated_at"""
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now(), nullable=False)