chore: Update dependencies and task list
This commit is contained in:
27
models.py
Normal file
27
models.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from sqlalchemy import Column, Integer, String, Text, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from .database import Base
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
# The user's unique ID from the platform (e.g., Twitch ID, YouTube Channel ID)
|
||||
platform_user_id = Column(String, unique=True, index=True, nullable=False)
|
||||
username = Column(String, index=True, nullable=False)
|
||||
platform = Column(String, nullable=False) # e.g., "twitch", "youtube"
|
||||
|
||||
# A JSON string or other format holding the encrypted access and refresh tokens
|
||||
encrypted_tokens = Column(Text, nullable=False)
|
||||
|
||||
settings = relationship("Setting", back_populates="owner", uselist=False)
|
||||
|
||||
class Setting(Base):
|
||||
__tablename__ = "settings"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
custom_css = Column(Text, nullable=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"))
|
||||
|
||||
owner = relationship("User", back_populates="settings")
|
||||
Reference in New Issue
Block a user