All checks were successful
Build Docker Image / build (push) Successful in 12m39s
34 lines
1.3 KiB
Python
34 lines
1.3 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)
|
|
category = Column(String(100), nullable=True)
|
|
view_count = Column(Integer, nullable=True)
|
|
subscriber_count = Column(Integer, nullable=True)
|
|
thumbnail_url = Column(String(255), nullable=True)
|
|
upload_date = Column(DateTime, nullable=True)
|
|
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"
|
|
)
|