Spaces:
Sleeping
Sleeping
# fastapi_crud/app/models.py | |
from sqlalchemy import Column, Integer, String, Boolean | |
from .database import Base | |
class User(Base): | |
__tablename__ = "users" | |
id = Column(Integer, primary_key=True, index=True) | |
username = Column(String, unique=True, index=True) | |
hashed_password = Column(String) | |
is_active = Column(Boolean, default=True) | |
class Device(Base): | |
__tablename__ = "devices" | |
id = Column(Integer, primary_key=True, index=True) | |
channel = Column(Integer, unique=True, index=True) | |
name = Column(String, index=True) | |
rating = Column(Integer) | |
location = Column(String) | |
active = Column(Boolean, default=False) | |