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
+8 -10
View File
@@ -1,14 +1,12 @@
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
from sqlalchemy import Column, Integer, BigInteger
from infra.db.base import Base, TimestampMixin
@dataclass
class DiscordHomeDebt:
id: Optional[int]
user_id: int
value: int
created_at: datetime
updated_at: datetime
class HomeDebt(Base, TimestampMixin):
__tablename__ = "home_debt"
id = Column(Integer, primary_key=True, autoincrement=True)
user_id = Column(BigInteger, nullable=False, unique=True)
value = Column(Integer, nullable=False, default=0)
def __str__(self):
return f"ID: {self.id}, User ID: {self.user_id}, Value: {self.value}, Created At: {self.created_at}, Updated At: {self.updated_at}"