From 186476ad319309533180fedc03ab181cea65a24e Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 11 Sep 2024 08:10:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=80=9A=E7=9F=A5=E5=8F=91=E9=80=81?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database/versions/262735d025da_2_0_1.py | 62 +++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 database/versions/262735d025da_2_0_1.py diff --git a/database/versions/262735d025da_2_0_1.py b/database/versions/262735d025da_2_0_1.py new file mode 100644 index 000000000..f79b50617 --- /dev/null +++ b/database/versions/262735d025da_2_0_1.py @@ -0,0 +1,62 @@ +"""2.0.1 + +Revision ID: 262735d025da +Revises: 294b007932ef +Create Date: 2024-09-11 08:07:02.753307 + +""" + +from app.db.systemconfig_oper import SystemConfigOper +from app.schemas.types import SystemConfigKey + +# revision identifiers, used by Alembic. +revision = '262735d025da' +down_revision = '294b007932ef' +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + # 初始化消息通知范围 + _systemconfig = SystemConfigOper() + if not _systemconfig.get(SystemConfigKey.NotificationSwitchs): + _systemconfig.set(SystemConfigKey.NotificationSwitchs, [ + { + 'type': '资源下载', + 'action': 'all', + }, + { + 'type': '整理入库', + 'action': 'all', + }, + { + 'type': '订阅', + 'action': 'all', + }, + { + 'type': '站点', + 'action': 'admin', + }, + { + 'type': '媒体服务器', + 'action': 'admin', + }, + { + 'type': '手动处理', + 'action': 'admin', + }, + { + 'type': '插件', + 'action': 'admin', + }, + { + 'type': '其它', + 'action': 'admin', + }, + ]) + # ### end Alembic commands ### + + +def downgrade() -> None: + pass