expand models.py to models/

This commit is contained in:
2026-05-16 04:18:12 +08:00
parent bc67f5a579
commit 3307ccf1ee
3 changed files with 18 additions and 12 deletions
+19
View File
@@ -0,0 +1,19 @@
from sqlalchemy import Column, DateTime, String
from sqlalchemy.sql import func
from .base import Base, gen_uuid
class User(Base):
__tablename__ = "users"
id = Column(String, primary_key=True, default=gen_uuid)
google_id = Column(String, unique=True, index=True)
email = Column(String, unique=True, index=True)
name = Column(String)
avatar = Column(String)
created_at = Column(DateTime(timezone=True), server_default=func.now())
def __repr__(self):
return f"<User(id={self.id}, name={self.name}, email={self.email})>"