mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
refactor: adjust database indexes by adding high-frequency composite indexes and removing redundant id indexes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import Column, Integer, String, Float, JSON, select
|
||||
from sqlalchemy import Column, Integer, String, Float, JSON, Index, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
@@ -73,6 +73,10 @@ class SubscribeHistory(Base):
|
||||
# 剧集组
|
||||
episode_group = Column(String)
|
||||
|
||||
__table_args__ = (
|
||||
Index('ix_subscribehistory_type_date', 'type', 'date'),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@db_query
|
||||
def list_by_type(cls, db: Session, mtype: str, page: Optional[int] = 1, count: Optional[int] = 30):
|
||||
|
||||
Reference in New Issue
Block a user