from sqlalchemy import Column, Integer, String, DateTime, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.sql import func from database import Base Base = declarative_base() class User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True, index=True) email = Column(String, unique=True, index=True) hashed_password = Column(String) is_verified = Column(Boolean, default=False) credits = Column(Integer, default=10000) selected_tts_models = Column(ARRAY(String), default=['default.onnx']) # Set the default value to 'default.onnx' # Define other user fields as needed # Add the relationship with VerificationToken verification_tokens = relationship("VerificationToken", back_populates="user") # Define other database models as needed class VerificationToken(Base): __tablename__ = "verification_tokens" id = Column(Integer, primary_key=True, index=True) token = Column(String, unique=True, index=True) user_id = Column(Integer, ForeignKey('users.id'), nullable=False) created_at = Column(DateTime(timezone=True), server_default=func.now()) # Define a relationship with the User model user = relationship("User", back_populates="verification_tokens")