mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-05 11:47:50 +08:00
SubscribeHistory 表结构修复
This commit is contained in:
@@ -58,12 +58,12 @@ class ConfigModel(BaseModel):
|
||||
DB_POOL_TYPE: str = "QueuePool"
|
||||
# 是否在获取连接时进行预先 ping 操作,默认关闭
|
||||
DB_POOL_PRE_PING: bool = False
|
||||
# 数据库连接池的大小,默认 20
|
||||
DB_POOL_SIZE: int = 20
|
||||
# 数据库连接池的大小,默认 100
|
||||
DB_POOL_SIZE: int = 100
|
||||
# 数据库连接的回收时间(秒),默认 1800 秒
|
||||
DB_POOL_RECYCLE: int = 1800
|
||||
# 数据库连接池获取连接的超时时间(秒),默认 30 秒
|
||||
DB_POOL_TIMEOUT: int = 30
|
||||
# 数据库连接池获取连接的超时时间(秒),默认 60 秒
|
||||
DB_POOL_TIMEOUT: int = 60
|
||||
# 数据库连接池最大溢出连接数,默认 10
|
||||
DB_MAX_OVERFLOW: int = 10
|
||||
# SQLite 的 busy_timeout 参数,默认为 60 秒
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from sqlalchemy import Column, Integer, String, Sequence, Float
|
||||
from sqlalchemy import Column, Integer, String, Sequence, Float, JSON
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.db import db_query, Base
|
||||
@@ -53,13 +53,19 @@ class SubscribeHistory(Base):
|
||||
# 订阅用户
|
||||
username = Column(String)
|
||||
# 订阅站点
|
||||
sites = Column(String)
|
||||
sites = Column(JSON)
|
||||
# 是否洗版
|
||||
best_version = Column(Integer, default=0)
|
||||
# 保存路径
|
||||
save_path = Column(String)
|
||||
# 是否使用 imdbid 搜索
|
||||
search_imdbid = Column(Integer, default=0)
|
||||
# 自定义识别词
|
||||
custom_words = Column(String)
|
||||
# 自定义媒体类别
|
||||
media_category = Column(String)
|
||||
# 过滤规则组
|
||||
filter_groups = Column(JSON, default=list)
|
||||
|
||||
@staticmethod
|
||||
@db_query
|
||||
|
||||
34
database/versions/ecf3c693fdf3_2_0_5.py
Normal file
34
database/versions/ecf3c693fdf3_2_0_5.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""2.0.5
|
||||
|
||||
Revision ID: ecf3c693fdf3
|
||||
Revises: a73f2dbf5c09
|
||||
Create Date: 2024-10-21 12:36:20.631963
|
||||
|
||||
"""
|
||||
import contextlib
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ecf3c693fdf3'
|
||||
down_revision = 'a73f2dbf5c09'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
# 将String转换为JSON类型
|
||||
with contextlib.suppress(Exception):
|
||||
op.alter_column('subscribehistory', 'sites', existing_type=sa.String(), type_=sa.JSON())
|
||||
with contextlib.suppress(Exception):
|
||||
op.add_column('subscribehistory', sa.Column('custom_words', sa.String(), nullable=True))
|
||||
op.add_column('subscribehistory', sa.Column('media_category', sa.String(), nullable=True))
|
||||
op.add_column('subscribehistory', sa.Column('filter_groups', sa.JSON(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
pass
|
||||
@@ -65,11 +65,6 @@ click==8.1.7
|
||||
# uvicorn
|
||||
cn2an==0.5.22
|
||||
# via -r requirements.in
|
||||
colorama==0.4.6
|
||||
# via
|
||||
# click
|
||||
# qrcode
|
||||
# tqdm
|
||||
coloredlogs==15.0.1
|
||||
# via aligo
|
||||
crcmod==1.7
|
||||
@@ -102,9 +97,7 @@ frozenlist==1.4.1
|
||||
func-timeout==4.3.5
|
||||
# via -r requirements.in
|
||||
greenlet==2.0.2
|
||||
# via
|
||||
# playwright
|
||||
# sqlalchemy
|
||||
# via playwright
|
||||
h11==0.14.0
|
||||
# via
|
||||
# httpcore
|
||||
@@ -192,6 +185,14 @@ pyee==9.0.4
|
||||
# via playwright
|
||||
pyjwt==2.7.0
|
||||
# via -r requirements.in
|
||||
pyobjc-core==10.3.1
|
||||
# via
|
||||
# pyobjc-framework-cocoa
|
||||
# pyobjc-framework-quartz
|
||||
pyobjc-framework-cocoa==10.3.1
|
||||
# via pyobjc-framework-quartz
|
||||
pyobjc-framework-quartz==10.3.1
|
||||
# via pystray
|
||||
pyotp==2.9.0
|
||||
# via -r requirements.in
|
||||
pyparsing==3.0.9
|
||||
@@ -200,8 +201,6 @@ pypng==0.20220715.0
|
||||
# via qrcode
|
||||
pyquery==2.0.0
|
||||
# via -r requirements.in
|
||||
pyreadline3==3.5.4
|
||||
# via humanfriendly
|
||||
pysocks==1.7.1
|
||||
# via requests
|
||||
pystray==0.19.5
|
||||
@@ -303,8 +302,6 @@ typing-extensions==4.12.2
|
||||
# qrcode
|
||||
# sqlalchemy
|
||||
# transmission-rpc
|
||||
tzdata==2024.2
|
||||
# via tzlocal
|
||||
tzlocal==5.2
|
||||
# via
|
||||
# apscheduler
|
||||
|
||||
Reference in New Issue
Block a user