Spaces:
Runtime error
Runtime error
| """ | |
| User model. | |
| """ | |
| from sqlalchemy import Boolean, Column, DateTime, Integer, String | |
| from sqlalchemy.orm import relationship | |
| from sqlalchemy.sql import func | |
| from app.Models.base import Base | |
| class User(Base): | |
| """User model.""" | |
| __tablename__ = "users" | |
| id = Column(Integer, primary_key=True, index=True) | |
| email = Column(String(255), unique=True, index=True, nullable=False) | |
| hashed_password = Column(String(255), nullable=False) | |
| is_active = Column(Boolean, default=True) | |
| is_superuser = Column(Boolean, default=False) | |
| full_name = Column(String(255), nullable=True) | |
| created_at = Column(DateTime(timezone=True), server_default=func.now()) | |
| updated_at = Column(DateTime(timezone=True), onupdate=func.now()) | |
| # Relationships | |
| line_users = relationship("LINEUser", back_populates="user") | |
| scraping_jobs = relationship("ScrapingJob", back_populates="user") | |
| ai_conversations = relationship("AIConversation", back_populates="user") |