up
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -14,6 +14,8 @@ class Video(Base):
|
||||
id: Mapped[int] = mapped_column(BIGINT(unsigned=True), primary_key=True, autoincrement=True)
|
||||
user_id: Mapped[int] = mapped_column(BIGINT(unsigned=True), comment="作者")
|
||||
category_id: Mapped[int] = mapped_column(default=0)
|
||||
series_id: Mapped[int | None] = mapped_column(BIGINT(unsigned=True))
|
||||
episode_no: Mapped[int | None] = mapped_column()
|
||||
title: Mapped[str] = mapped_column(String(100), default="")
|
||||
description: Mapped[str] = mapped_column(String(500), default="")
|
||||
cover_url: Mapped[str] = mapped_column(String(500), default="")
|
||||
@@ -89,3 +91,26 @@ class TranscodeTask(Base):
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(), onupdate=func.now())
|
||||
|
||||
__table_args__ = (Index("idx_pick", "task_status", "priority", "created_at"),)
|
||||
|
||||
|
||||
class Series(Base):
|
||||
"""系列(合集):把多条视频组织成一个集数列表"""
|
||||
|
||||
__tablename__ = "series"
|
||||
|
||||
id: Mapped[int] = mapped_column(BIGINT(unsigned=True), primary_key=True, autoincrement=True)
|
||||
title: Mapped[str] = mapped_column(String(100), default="")
|
||||
cover_url: Mapped[str] = mapped_column(String(500), default="")
|
||||
description: Mapped[str] = mapped_column(String(500), default="")
|
||||
author_id: Mapped[int | None] = mapped_column(BIGINT(unsigned=True))
|
||||
category_id: Mapped[int] = mapped_column(default=0)
|
||||
total_episodes: Mapped[int] = mapped_column(default=0)
|
||||
view_count: Mapped[int] = mapped_column(BigInteger, default=0)
|
||||
status: Mapped[int] = mapped_column(SmallInteger, default=1, comment="1正常 0隐藏")
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now(), onupdate=func.now())
|
||||
|
||||
__table_args__ = (
|
||||
Index("idx_series_cat_status", "category_id", "status"),
|
||||
Index("idx_series_status_created", "status", "created_at"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user