ksyasuda af0d958b89
All checks were successful
Build Docker Image / build (push) Successful in 12m54s
update code structure and get session on each query
2025-02-09 20:20:10 -08:00

29 lines
1.0 KiB
Python

from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.sql import func
from sqlalchemy.orm import declarative_base
Base = declarative_base()
class WatchHistory(Base):
__tablename__ = "watch_history"
whid = Column(Integer, primary_key=True, autoincrement=True)
video_url = Column(String(255), nullable=False)
video_name = Column(String(255), nullable=False)
channel_url = Column(String(255), nullable=False)
channel_name = Column(String(255), nullable=False)
watch_date = Column(DateTime, nullable=False, server_default=func.now())
created_by = Column(
String(100), nullable=False, server_default="mpv-youtube-queue-server"
)
class SavedQueue(Base):
__tablename__ = "saved_queue"
sqid = Column(Integer, primary_key=True, autoincrement=True)
video_url = Column(String(255), nullable=False)
created_date = Column(DateTime, nullable=False, server_default=func.now())
created_by = Column(
String(100), nullable=False, server_default="mpv-youtube-queue-server"
)