21 lines
702 B
Python
21 lines
702 B
Python
from sqlalchemy import Column, ForeignKey, Integer, String, Text
|
|
from sqlalchemy.orm import relationship
|
|
from app.api.db.database import Base
|
|
|
|
class User(Base):
|
|
__tablename__ = 'user'
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
# Add relevant foreign keys and entity-specific fields here
|
|
# For example:
|
|
# email = Column(String, unique=True, index=True, nullable=False)
|
|
# hashed_password = Column(String, nullable=False)
|
|
# full_name = Column(String, nullable=False)
|
|
# bio = Column(Text, nullable=True)
|
|
|
|
# Relationships
|
|
# For example:
|
|
# posts = relationship("Post", back_populates="author")
|
|
|
|
def __repr__(self):
|
|
return f"User(id={self.id})" |