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';"""