mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 03:27:31 +08:00
refactor: adjust database indexes by adding high-frequency composite indexes and removing redundant id indexes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import Column, Integer, JSON, String, and_, or_, select
|
||||
from sqlalchemy import Column, Integer, JSON, String, Index, and_, or_, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.db import Base, db_query, get_id_column, db_update, async_db_query, async_db_update
|
||||
@@ -44,6 +44,10 @@ class Workflow(Base):
|
||||
# 最后执行时间
|
||||
last_time = Column(String)
|
||||
|
||||
__table_args__ = (
|
||||
Index('ix_workflow_trigger_type_state', 'trigger_type', 'state'),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@db_query
|
||||
def list(cls, db):
|
||||
|
||||
Reference in New Issue
Block a user