Spaces:
Sleeping
Sleeping
from sqlalchemy import Column, Integer, String | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
Base = declarative_base() | |
class User(Base): | |
__tablename__ = "users" | |
id = Column(Integer, primary_key=True) | |
name = Column(String) | |
profile = Column(String) | |
team_id = Column(Integer, ForeignKey("teams.id")) | |
team = relationship("Team", backref="users") | |
class Team(Base): | |
__tablename__ = "teams" | |
id = Column(Integer, primary_key=True) | |
name = Column(String) |