From 468e3090c4edf220ab0e24569745b49a06d74e80 Mon Sep 17 00:00:00 2001 From: Miyamizu-MitsuhaSang <2510681107@qq.com> Date: Sun, 17 Aug 2025 16:20:05 +0800 Subject: [PATCH] =?UTF-8?q?settings.py:=20-=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=EF=BC=88=E7=94=B1=E4=BA=8E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=9E=E6=8E=A5=E6=9B=B4=E6=96=B0=EF=BC=89=20-?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E5=A4=9A=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=EF=BC=88=E9=A2=84=E7=95=99prod=5Fdb=E5=A4=87?= =?UTF-8?q?=E7=94=A8=EF=BC=89=20backfill=5Fsearch=5Ftext.py:=20-=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E5=9B=9E=E5=A1=ABsearch=5Ftext=E8=84=9A=E6=9C=AC=20si?= =?UTF-8?q?gnals.py:=20-=E5=90=8E=E7=BB=AD=E5=8A=A0=E5=85=A5=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=97=B6=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86text?= =?UTF-8?q?=E4=B8=BAsearch=5Ftext=20./scripts:=20-=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=AF=BC=E5=85=A5=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 8 ++++++++ migrations/models/17_20250817140345_update.py | 15 +++++++++++++++ migrations/models/18_20250817145807_update.py | 11 +++++++++++ migrations/models/19_20250817152505_update.py | 11 +++++++++++ 4 files changed, 45 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 migrations/models/17_20250817140345_update.py create mode 100644 migrations/models/18_20250817145807_update.py create mode 100644 migrations/models/19_20250817152505_update.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/migrations/models/17_20250817140345_update.py b/migrations/models/17_20250817140345_update.py new file mode 100644 index 0000000..683577a --- /dev/null +++ b/migrations/models/17_20250817140345_update.py @@ -0,0 +1,15 @@ +from tortoise import BaseDBAsyncClient + + +async def upgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE `wordlist_fr` ADD `freq` INT NOT NULL; + ALTER TABLE `wordlist_fr` ADD `search_text` VARCHAR(255) NOT NULL; + ALTER TABLE `wordlist_fr` ADD INDEX `idx_wordlist_fr_search__5455f1` (`search_text`);""" + + +async def downgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE `wordlist_fr` DROP INDEX `idx_wordlist_fr_search__5455f1`; + ALTER TABLE `wordlist_fr` DROP COLUMN `freq`; + ALTER TABLE `wordlist_fr` DROP COLUMN `search_text`;""" diff --git a/migrations/models/18_20250817145807_update.py b/migrations/models/18_20250817145807_update.py new file mode 100644 index 0000000..5e1357b --- /dev/null +++ b/migrations/models/18_20250817145807_update.py @@ -0,0 +1,11 @@ +from tortoise import BaseDBAsyncClient + + +async def upgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE `wordlist_fr` DROP COLUMN `language`;""" + + +async def downgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE `wordlist_fr` ADD `language` VARCHAR(20) NOT NULL COMMENT '单词语种';""" diff --git a/migrations/models/19_20250817152505_update.py b/migrations/models/19_20250817152505_update.py new file mode 100644 index 0000000..6110d0b --- /dev/null +++ b/migrations/models/19_20250817152505_update.py @@ -0,0 +1,11 @@ +from tortoise import BaseDBAsyncClient + + +async def upgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE `definitions_fr` MODIFY COLUMN `pos` VARCHAR(30) COMMENT 'n: n.\nn_f: n.f.\nn_f_pl: n.f.pl.\nn_m: n.m.\nn_m_pl: n.m.pl.\nv: v.\nv_t: v.t.\nv_i: v.i.\nv_pr: v.pr.\nv_t_i: v.t./v.i.\nadj: adj.\nadv: adv.\nprep: prep.\npron: pron.\nconj: conj.\ninterj: interj.\nchauff: chauff';""" + + +async def downgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE `definitions_fr` MODIFY COLUMN `pos` VARCHAR(30) NOT NULL COMMENT 'n: n.\nn_f: n.f.\nn_f_pl: n.f.pl.\nn_m: n.m.\nn_m_pl: n.m.pl.\nv: v.\nv_t: v.t.\nv_i: v.i.\nv_pr: v.pr.\nv_t_i: v.t./v.i.\nadj: adj.\nadv: adv.\nprep: prep.\npron: pron.\nconj: conj.\ninterj: interj.\nchauff: chauff';"""