From 2b1ad18e18939c230cd0ef5fae05dc5cf15e0172 Mon Sep 17 00:00:00 2001 From: "jayeeliu@gmail.com" Date: Sat, 2 Mar 2024 23:05:34 +0800 Subject: [PATCH] Revert "feat: add aerich for migrate db" This reverts commit 5f7cd715db210c71f90fb8b1167681810c7c9a86. --- db.py | 16 +- migrations/models/0_20240302150109_init.py | 214 ------------------ ...reate_creator_and_add_video_url_for_xhs.py | 29 --- pyproject.toml | 4 - 4 files changed, 1 insertion(+), 262 deletions(-) delete mode 100644 migrations/models/0_20240302150109_init.py delete mode 100644 migrations/models/1_20240302150145_create_creator_and_add_video_url_for_xhs.py delete mode 100644 pyproject.toml diff --git a/db.py b/db.py index f8c4c2a..b1bc15e 100644 --- a/db.py +++ b/db.py @@ -7,7 +7,7 @@ from tools import utils def get_platform_models() -> List[str]: - models = ["aerich.models", "store.xhs", "store.douyin", "store.bilibili", "store.kuaishou", "store.weibo"] + models = ["store.xhs", "store.douyin", "store.bilibili", "store.kuaishou", "store.weibo"] return models @@ -24,22 +24,8 @@ async def close() -> None: async def init(): await init_db(create_db=True) await Tortoise.generate_schemas() - await init_aerich() utils.logger.info("[db.init] Init DB Success!") -TORTOISE_ORM_CONFIG = { - "connections": {"default": RELATION_DB_URL}, - "apps": { - "models": { - "models": get_platform_models(), - "default_connection": "default", - }, - }, -} - -async def init_aerich(): - Tortoise.get_connection('default').execute_insert("""INSERT INTO aerich VALUES(1,'0_20240302150109_init.py','models','{"models.Aerich": {"name": "models.Aerich", "app": "models", "table": "aerich", "abstract": false, "description": null, "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": null, "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "version", "field_type": "CharField", "db_column": "version", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": null, "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "app", "field_type": "CharField", "db_column": "app", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": null, "docstring": null, "constraints": {"max_length": 100}, "db_field_types": {"": "VARCHAR(100)"}}, {"name": "content", "field_type": "JSONField", "db_column": "content", "python_type": "Union[dict, list]", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": null, "docstring": null, "constraints": {}, "db_field_types": {"": "JSON", "mssql": "NVARCHAR(MAX)", "oracle": "NCLOB", "postgres": "JSONB"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.XHSNote": {"name": "models.XHSNote", "app": "models", "table": "xhs_note", "abstract": false, "description": "\u5c0f\u7ea2\u4e66\u7b14\u8bb0", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "ip_location", "field_type": "CharField", "db_column": "ip_location", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u7684IP\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "note_id", "field_type": "CharField", "db_column": "note_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u7b14\u8bb0ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "type", "field_type": "CharField", "db_column": "type", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u7c7b\u578b(normal | video)", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "title", "field_type": "CharField", "db_column": "title", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u6807\u9898", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "desc", "field_type": "TextField", "db_column": "desc", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u63cf\u8ff0", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "time", "field_type": "BigIntField", "db_column": "time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u7b14\u8bb0\u53d1\u5e03\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_update_time", "field_type": "BigIntField", "db_column": "last_update_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u6700\u540e\u66f4\u65b0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "liked_count", "field_type": "CharField", "db_column": "liked_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u70b9\u8d5e\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "collected_count", "field_type": "CharField", "db_column": "collected_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u6536\u85cf\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "comment_count", "field_type": "CharField", "db_column": "comment_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u8bc4\u8bba\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "share_count", "field_type": "CharField", "db_column": "share_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u5206\u4eab\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "image_list", "field_type": "TextField", "db_column": "image_list", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u5c01\u9762\u56fe\u7247\u5217\u8868", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "note_url", "field_type": "CharField", "db_column": "note_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0\u8be6\u60c5\u9875\u7684URL", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.XHSNoteComment": {"name": "models.XHSNoteComment", "app": "models", "table": "xhs_note_comment", "abstract": false, "description": "\u5c0f\u7ea2\u4e66\u7b14\u8bb0\u8bc4\u8bba", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "ip_location", "field_type": "CharField", "db_column": "ip_location", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u7684IP\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "comment_id", "field_type": "CharField", "db_column": "comment_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u8bc4\u8bbaID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u8bc4\u8bba\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "note_id", "field_type": "CharField", "db_column": "note_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u7b14\u8bb0ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "content", "field_type": "TextField", "db_column": "content", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u5185\u5bb9", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "sub_comment_count", "field_type": "IntField", "db_column": "sub_comment_count", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u5b50\u8bc4\u8bba\u6570\u91cf", "docstring": null, "constraints": {"ge": -2147483648, "le": 2147483647}, "db_field_types": {"": "INT"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.DouyinAweme": {"name": "models.DouyinAweme", "app": "models", "table": "douyin_aweme", "abstract": false, "description": "\u6296\u97f3\u89c6\u9891", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "sec_uid", "field_type": "CharField", "db_column": "sec_uid", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237sec_uid", "docstring": null, "constraints": {"max_length": 128}, "db_field_types": {"": "VARCHAR(128)"}}, {"name": "short_user_id", "field_type": "CharField", "db_column": "short_user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u77edID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "user_unique_id", "field_type": "CharField", "db_column": "user_unique_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u552f\u4e00ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "user_signature", "field_type": "CharField", "db_column": "user_signature", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u7b7e\u540d", "docstring": null, "constraints": {"max_length": 500}, "db_field_types": {"": "VARCHAR(500)"}}, {"name": "ip_location", "field_type": "CharField", "db_column": "ip_location", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u7684IP\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "aweme_id", "field_type": "CharField", "db_column": "aweme_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "aweme_type", "field_type": "CharField", "db_column": "aweme_type", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u7c7b\u578b", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "title", "field_type": "CharField", "db_column": "title", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u6807\u9898", "docstring": null, "constraints": {"max_length": 500}, "db_field_types": {"": "VARCHAR(500)"}}, {"name": "desc", "field_type": "TextField", "db_column": "desc", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u63cf\u8ff0", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891\u53d1\u5e03\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "liked_count", "field_type": "CharField", "db_column": "liked_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u70b9\u8d5e\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "comment_count", "field_type": "CharField", "db_column": "comment_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u8bc4\u8bba\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "share_count", "field_type": "CharField", "db_column": "share_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u5206\u4eab\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "collected_count", "field_type": "CharField", "db_column": "collected_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u6536\u85cf\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "aweme_url", "field_type": "CharField", "db_column": "aweme_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u8be6\u60c5\u9875URL", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.DouyinAwemeComment": {"name": "models.DouyinAwemeComment", "app": "models", "table": "douyin_aweme_comment", "abstract": false, "description": "\u6296\u97f3\u89c6\u9891\u8bc4\u8bba", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "sec_uid", "field_type": "CharField", "db_column": "sec_uid", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237sec_uid", "docstring": null, "constraints": {"max_length": 128}, "db_field_types": {"": "VARCHAR(128)"}}, {"name": "short_user_id", "field_type": "CharField", "db_column": "short_user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u77edID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "user_unique_id", "field_type": "CharField", "db_column": "user_unique_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u552f\u4e00ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "user_signature", "field_type": "CharField", "db_column": "user_signature", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u7b7e\u540d", "docstring": null, "constraints": {"max_length": 500}, "db_field_types": {"": "VARCHAR(500)"}}, {"name": "ip_location", "field_type": "CharField", "db_column": "ip_location", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u7684IP\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "comment_id", "field_type": "CharField", "db_column": "comment_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u8bc4\u8bbaID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "aweme_id", "field_type": "CharField", "db_column": "aweme_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "content", "field_type": "TextField", "db_column": "content", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u5185\u5bb9", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "sub_comment_count", "field_type": "CharField", "db_column": "sub_comment_count", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u56de\u590d\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.BilibiliComment": {"name": "models.BilibiliComment", "app": "models", "table": "bilibili_video_comment", "abstract": false, "description": "B \u7ad9\u89c6\u9891\u8bc4\u8bba", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "comment_id", "field_type": "CharField", "db_column": "comment_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u8bc4\u8bbaID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "video_id", "field_type": "CharField", "db_column": "video_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "content", "field_type": "TextField", "db_column": "content", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u5185\u5bb9", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "sub_comment_count", "field_type": "CharField", "db_column": "sub_comment_count", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u56de\u590d\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.BilibiliVideo": {"name": "models.BilibiliVideo", "app": "models", "table": "bilibili_video", "abstract": false, "description": "B\u7ad9\u89c6\u9891", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "video_id", "field_type": "CharField", "db_column": "video_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "video_type", "field_type": "CharField", "db_column": "video_type", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u7c7b\u578b", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "title", "field_type": "CharField", "db_column": "title", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u6807\u9898", "docstring": null, "constraints": {"max_length": 500}, "db_field_types": {"": "VARCHAR(500)"}}, {"name": "desc", "field_type": "TextField", "db_column": "desc", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u63cf\u8ff0", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891\u53d1\u5e03\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "liked_count", "field_type": "CharField", "db_column": "liked_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u70b9\u8d5e\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "video_play_count", "field_type": "CharField", "db_column": "video_play_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u64ad\u653e\u6570\u91cf", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "video_danmaku", "field_type": "CharField", "db_column": "video_danmaku", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u5f39\u5e55\u6570\u91cf", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "video_comment", "field_type": "CharField", "db_column": "video_comment", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u8bc4\u8bba\u6570\u91cf", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "video_url", "field_type": "CharField", "db_column": "video_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u8be6\u60c5URL", "docstring": null, "constraints": {"max_length": 512}, "db_field_types": {"": "VARCHAR(512)"}}, {"name": "video_cover_url", "field_type": "CharField", "db_column": "video_cover_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u5c01\u9762\u56fe URL", "docstring": null, "constraints": {"max_length": 512}, "db_field_types": {"": "VARCHAR(512)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.KuaishouVideo": {"name": "models.KuaishouVideo", "app": "models", "table": "kuaishou_video", "abstract": false, "description": "\u5feb\u624b\u89c6\u9891", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "video_id", "field_type": "CharField", "db_column": "video_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "video_type", "field_type": "CharField", "db_column": "video_type", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u7c7b\u578b", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "title", "field_type": "CharField", "db_column": "title", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u6807\u9898", "docstring": null, "constraints": {"max_length": 500}, "db_field_types": {"": "VARCHAR(500)"}}, {"name": "desc", "field_type": "TextField", "db_column": "desc", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u63cf\u8ff0", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891\u53d1\u5e03\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "liked_count", "field_type": "CharField", "db_column": "liked_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u70b9\u8d5e\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "viewd_count", "field_type": "CharField", "db_column": "viewd_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u6d4f\u89c8\u6570\u91cf", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "video_url", "field_type": "CharField", "db_column": "video_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u8be6\u60c5URL", "docstring": null, "constraints": {"max_length": 512}, "db_field_types": {"": "VARCHAR(512)"}}, {"name": "video_cover_url", "field_type": "CharField", "db_column": "video_cover_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u5c01\u9762\u56fe URL", "docstring": null, "constraints": {"max_length": 512}, "db_field_types": {"": "VARCHAR(512)"}}, {"name": "video_play_url", "field_type": "CharField", "db_column": "video_play_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u89c6\u9891\u64ad\u653e URL", "docstring": null, "constraints": {"max_length": 512}, "db_field_types": {"": "VARCHAR(512)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.KuaishouVideoComment": {"name": "models.KuaishouVideoComment", "app": "models", "table": "kuaishou_video_comment", "abstract": false, "description": "\u5feb\u624b\u89c6\u9891\u8bc4\u8bba", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "comment_id", "field_type": "CharField", "db_column": "comment_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u8bc4\u8bbaID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "video_id", "field_type": "CharField", "db_column": "video_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u89c6\u9891ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "content", "field_type": "TextField", "db_column": "content", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u5185\u5bb9", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "sub_comment_count", "field_type": "CharField", "db_column": "sub_comment_count", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u56de\u590d\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.WeiboComment": {"name": "models.WeiboComment", "app": "models", "table": "weibo_note_comment", "abstract": false, "description": "\u5fae\u535a\u5e16\u5b50\u8bc4\u8bba", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "gender", "field_type": "CharField", "db_column": "gender", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6027\u522b", "docstring": null, "constraints": {"max_length": 12}, "db_field_types": {"": "VARCHAR(12)"}}, {"name": "profile_url", "field_type": "CharField", "db_column": "profile_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u4e3b\u9875\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "ip_location", "field_type": "CharField", "db_column": "ip_location", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": "\u53d1\u5e03\u5fae\u535a\u7684\u5730\u7406\u4fe1\u606f", "description": null, "docstring": null, "constraints": {"max_length": 32}, "db_field_types": {"": "VARCHAR(32)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "comment_id", "field_type": "CharField", "db_column": "comment_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u8bc4\u8bbaID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "note_id", "field_type": "CharField", "db_column": "note_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u5e16\u5b50ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "content", "field_type": "TextField", "db_column": "content", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u5185\u5bb9", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "create_date_time", "field_type": "CharField", "db_column": "create_date_time", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u8bc4\u8bba\u65e5\u671f\u65f6\u95f4", "docstring": null, "constraints": {"max_length": 32}, "db_field_types": {"": "VARCHAR(32)"}}, {"name": "comment_like_count", "field_type": "CharField", "db_column": "comment_like_count", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u70b9\u8d5e\u6570\u91cf", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "sub_comment_count", "field_type": "CharField", "db_column": "sub_comment_count", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bc4\u8bba\u56de\u590d\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}, "models.WeiboNote": {"name": "models.WeiboNote", "app": "models", "table": "weibo_note", "abstract": false, "description": "\u5fae\u535a\u5e16\u5b50", "docstring": null, "unique_together": [], "indexes": [], "pk_field": {"name": "id", "field_type": "IntField", "db_column": "id", "python_type": "int", "generated": true, "nullable": false, "unique": true, "indexed": true, "default": null, "description": "\u81ea\u589eID", "docstring": null, "constraints": {"ge": 1, "le": 2147483647}, "db_field_types": {"": "INT"}}, "data_fields": [{"name": "user_id", "field_type": "CharField", "db_column": "user_id", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "nickname", "field_type": "CharField", "db_column": "nickname", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6635\u79f0", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "avatar", "field_type": "CharField", "db_column": "avatar", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u5934\u50cf\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "gender", "field_type": "CharField", "db_column": "gender", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u6027\u522b", "docstring": null, "constraints": {"max_length": 12}, "db_field_types": {"": "VARCHAR(12)"}}, {"name": "profile_url", "field_type": "CharField", "db_column": "profile_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u7528\u6237\u4e3b\u9875\u5730\u5740", "docstring": null, "constraints": {"max_length": 255}, "db_field_types": {"": "VARCHAR(255)"}}, {"name": "ip_location", "field_type": "CharField", "db_column": "ip_location", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": "\u53d1\u5e03\u5fae\u535a\u7684\u5730\u7406\u4fe1\u606f", "description": null, "docstring": null, "constraints": {"max_length": 32}, "db_field_types": {"": "VARCHAR(32)"}}, {"name": "add_ts", "field_type": "BigIntField", "db_column": "add_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6dfb\u52a0\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "last_modify_ts", "field_type": "BigIntField", "db_column": "last_modify_ts", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": false, "default": null, "description": "\u8bb0\u5f55\u6700\u540e\u4fee\u6539\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "note_id", "field_type": "CharField", "db_column": "note_id", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u5e16\u5b50ID", "docstring": null, "constraints": {"max_length": 64}, "db_field_types": {"": "VARCHAR(64)"}}, {"name": "content", "field_type": "TextField", "db_column": "content", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u5e16\u5b50\u6b63\u6587\u5185\u5bb9", "docstring": null, "constraints": {}, "db_field_types": {"": "TEXT", "mssql": "NVARCHAR(MAX)", "mysql": "LONGTEXT", "oracle": "NCLOB"}}, {"name": "create_time", "field_type": "BigIntField", "db_column": "create_time", "python_type": "int", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u5e16\u5b50\u53d1\u5e03\u65f6\u95f4\u6233", "docstring": null, "constraints": {"ge": -9223372036854775808, "le": 9223372036854775807}, "db_field_types": {"": "BIGINT", "oracle": "INT"}}, {"name": "create_date_time", "field_type": "CharField", "db_column": "create_date_time", "python_type": "str", "generated": false, "nullable": false, "unique": false, "indexed": true, "default": null, "description": "\u5e16\u5b50\u53d1\u5e03\u65e5\u671f\u65f6\u95f4", "docstring": null, "constraints": {"max_length": 32}, "db_field_types": {"": "VARCHAR(32)"}}, {"name": "liked_count", "field_type": "CharField", "db_column": "liked_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u5e16\u5b50\u70b9\u8d5e\u6570", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "comments_count", "field_type": "CharField", "db_column": "comments_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u5e16\u5b50\u8bc4\u8bba\u6570\u91cf", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "shared_count", "field_type": "CharField", "db_column": "shared_count", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u5e16\u5b50\u8f6c\u53d1\u6570\u91cf", "docstring": null, "constraints": {"max_length": 16}, "db_field_types": {"": "VARCHAR(16)"}}, {"name": "note_url", "field_type": "CharField", "db_column": "note_url", "python_type": "str", "generated": false, "nullable": true, "unique": false, "indexed": false, "default": null, "description": "\u5e16\u5b50\u8be6\u60c5URL", "docstring": null, "constraints": {"max_length": 512}, "db_field_types": {"": "VARCHAR(512)"}}], "fk_fields": [], "backward_fk_fields": [], "o2o_fields": [], "backward_o2o_fields": [], "m2m_fields": []}}');""", []) - if __name__ == '__main__': run_async(init()) diff --git a/migrations/models/0_20240302150109_init.py b/migrations/models/0_20240302150109_init.py deleted file mode 100644 index 380c6f5..0000000 --- a/migrations/models/0_20240302150109_init.py +++ /dev/null @@ -1,214 +0,0 @@ -from tortoise import BaseDBAsyncClient - - -async def upgrade(db: BaseDBAsyncClient) -> str: - return """ - CREATE TABLE IF NOT EXISTS "aerich" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "version" VARCHAR(255) NOT NULL, - "app" VARCHAR(100) NOT NULL, - "content" JSON NOT NULL -); -CREATE TABLE IF NOT EXISTS "xhs_note" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) NOT NULL /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "ip_location" VARCHAR(255) /* 评论时的IP地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "note_id" VARCHAR(64) NOT NULL /* 笔记ID */, - "type" VARCHAR(16) /* 笔记类型(normal | video) */, - "title" VARCHAR(255) /* 笔记标题 */, - "desc" TEXT /* 笔记描述 */, - "time" BIGINT NOT NULL /* 笔记发布时间戳 */, - "last_update_time" BIGINT NOT NULL /* 笔记最后更新时间戳 */, - "liked_count" VARCHAR(16) /* 笔记点赞数 */, - "collected_count" VARCHAR(16) /* 笔记收藏数 */, - "comment_count" VARCHAR(16) /* 笔记评论数 */, - "share_count" VARCHAR(16) /* 笔记分享数 */, - "image_list" TEXT /* 笔记封面图片列表 */, - "note_url" VARCHAR(255) /* 笔记详情页的URL */ -) /* 小红书笔记 */; -CREATE INDEX IF NOT EXISTS "idx_xhs_note_note_id_209457" ON "xhs_note" ("note_id"); -CREATE INDEX IF NOT EXISTS "idx_xhs_note_time_eaa910" ON "xhs_note" ("time"); -CREATE TABLE IF NOT EXISTS "xhs_note_comment" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) NOT NULL /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "ip_location" VARCHAR(255) /* 评论时的IP地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "comment_id" VARCHAR(64) NOT NULL /* 评论ID */, - "create_time" BIGINT NOT NULL /* 评论时间戳 */, - "note_id" VARCHAR(64) NOT NULL /* 笔记ID */, - "content" TEXT NOT NULL /* 评论内容 */, - "sub_comment_count" INT NOT NULL /* 子评论数量 */ -) /* 小红书笔记评论 */; -CREATE INDEX IF NOT EXISTS "idx_xhs_note_co_comment_8e8349" ON "xhs_note_comment" ("comment_id"); -CREATE INDEX IF NOT EXISTS "idx_xhs_note_co_create__204f8d" ON "xhs_note_comment" ("create_time"); -CREATE TABLE IF NOT EXISTS "douyin_aweme" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "sec_uid" VARCHAR(128) /* 用户sec_uid */, - "short_user_id" VARCHAR(64) /* 用户短ID */, - "user_unique_id" VARCHAR(64) /* 用户唯一ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "user_signature" VARCHAR(500) /* 用户签名 */, - "ip_location" VARCHAR(255) /* 评论时的IP地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "aweme_id" VARCHAR(64) NOT NULL /* 视频ID */, - "aweme_type" VARCHAR(16) NOT NULL /* 视频类型 */, - "title" VARCHAR(500) /* 视频标题 */, - "desc" TEXT /* 视频描述 */, - "create_time" BIGINT NOT NULL /* 视频发布时间戳 */, - "liked_count" VARCHAR(16) /* 视频点赞数 */, - "comment_count" VARCHAR(16) /* 视频评论数 */, - "share_count" VARCHAR(16) /* 视频分享数 */, - "collected_count" VARCHAR(16) /* 视频收藏数 */, - "aweme_url" VARCHAR(255) /* 视频详情页URL */ -) /* 抖音视频 */; -CREATE INDEX IF NOT EXISTS "idx_douyin_awem_aweme_i_6f7bc6" ON "douyin_aweme" ("aweme_id"); -CREATE INDEX IF NOT EXISTS "idx_douyin_awem_create__299dfe" ON "douyin_aweme" ("create_time"); -CREATE TABLE IF NOT EXISTS "douyin_aweme_comment" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "sec_uid" VARCHAR(128) /* 用户sec_uid */, - "short_user_id" VARCHAR(64) /* 用户短ID */, - "user_unique_id" VARCHAR(64) /* 用户唯一ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "user_signature" VARCHAR(500) /* 用户签名 */, - "ip_location" VARCHAR(255) /* 评论时的IP地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "comment_id" VARCHAR(64) NOT NULL /* 评论ID */, - "aweme_id" VARCHAR(64) NOT NULL /* 视频ID */, - "content" TEXT /* 评论内容 */, - "create_time" BIGINT NOT NULL /* 评论时间戳 */, - "sub_comment_count" VARCHAR(16) NOT NULL /* 评论回复数 */ -) /* 抖音视频评论 */; -CREATE INDEX IF NOT EXISTS "idx_douyin_awem_comment_fcd7e4" ON "douyin_aweme_comment" ("comment_id"); -CREATE INDEX IF NOT EXISTS "idx_douyin_awem_aweme_i_c50049" ON "douyin_aweme_comment" ("aweme_id"); -CREATE TABLE IF NOT EXISTS "bilibili_video_comment" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "comment_id" VARCHAR(64) NOT NULL /* 评论ID */, - "video_id" VARCHAR(64) NOT NULL /* 视频ID */, - "content" TEXT /* 评论内容 */, - "create_time" BIGINT NOT NULL /* 评论时间戳 */, - "sub_comment_count" VARCHAR(16) NOT NULL /* 评论回复数 */ -) /* B 站视频评论 */; -CREATE INDEX IF NOT EXISTS "idx_bilibili_vi_comment_41c34e" ON "bilibili_video_comment" ("comment_id"); -CREATE INDEX IF NOT EXISTS "idx_bilibili_vi_video_i_f22873" ON "bilibili_video_comment" ("video_id"); -CREATE TABLE IF NOT EXISTS "bilibili_video" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "video_id" VARCHAR(64) NOT NULL /* 视频ID */, - "video_type" VARCHAR(16) NOT NULL /* 视频类型 */, - "title" VARCHAR(500) /* 视频标题 */, - "desc" TEXT /* 视频描述 */, - "create_time" BIGINT NOT NULL /* 视频发布时间戳 */, - "liked_count" VARCHAR(16) /* 视频点赞数 */, - "video_play_count" VARCHAR(16) /* 视频播放数量 */, - "video_danmaku" VARCHAR(16) /* 视频弹幕数量 */, - "video_comment" VARCHAR(16) /* 视频评论数量 */, - "video_url" VARCHAR(512) /* 视频详情URL */, - "video_cover_url" VARCHAR(512) /* 视频封面图 URL */ -) /* B站视频 */; -CREATE INDEX IF NOT EXISTS "idx_bilibili_vi_video_i_31c36e" ON "bilibili_video" ("video_id"); -CREATE INDEX IF NOT EXISTS "idx_bilibili_vi_create__73e0ec" ON "bilibili_video" ("create_time"); -CREATE TABLE IF NOT EXISTS "kuaishou_video" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "video_id" VARCHAR(64) NOT NULL /* 视频ID */, - "video_type" VARCHAR(16) NOT NULL /* 视频类型 */, - "title" VARCHAR(500) /* 视频标题 */, - "desc" TEXT /* 视频描述 */, - "create_time" BIGINT NOT NULL /* 视频发布时间戳 */, - "liked_count" VARCHAR(16) /* 视频点赞数 */, - "viewd_count" VARCHAR(16) /* 视频浏览数量 */, - "video_url" VARCHAR(512) /* 视频详情URL */, - "video_cover_url" VARCHAR(512) /* 视频封面图 URL */, - "video_play_url" VARCHAR(512) /* 视频播放 URL */ -) /* 快手视频 */; -CREATE INDEX IF NOT EXISTS "idx_kuaishou_vi_video_i_c5c6a6" ON "kuaishou_video" ("video_id"); -CREATE INDEX IF NOT EXISTS "idx_kuaishou_vi_create__a10dee" ON "kuaishou_video" ("create_time"); -CREATE TABLE IF NOT EXISTS "kuaishou_video_comment" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "comment_id" VARCHAR(64) NOT NULL /* 评论ID */, - "video_id" VARCHAR(64) NOT NULL /* 视频ID */, - "content" TEXT /* 评论内容 */, - "create_time" BIGINT NOT NULL /* 评论时间戳 */, - "sub_comment_count" VARCHAR(16) NOT NULL /* 评论回复数 */ -) /* 快手视频评论 */; -CREATE INDEX IF NOT EXISTS "idx_kuaishou_vi_comment_ed48fa" ON "kuaishou_video_comment" ("comment_id"); -CREATE INDEX IF NOT EXISTS "idx_kuaishou_vi_video_i_e50914" ON "kuaishou_video_comment" ("video_id"); -CREATE TABLE IF NOT EXISTS "weibo_note_comment" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "gender" VARCHAR(12) /* 用户性别 */, - "profile_url" VARCHAR(255) /* 用户主页地址 */, - "ip_location" VARCHAR(32) DEFAULT '发布微博的地理信息', - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "comment_id" VARCHAR(64) NOT NULL /* 评论ID */, - "note_id" VARCHAR(64) NOT NULL /* 帖子ID */, - "content" TEXT /* 评论内容 */, - "create_time" BIGINT NOT NULL /* 评论时间戳 */, - "create_date_time" VARCHAR(32) NOT NULL /* 评论日期时间 */, - "comment_like_count" VARCHAR(16) NOT NULL /* 评论点赞数量 */, - "sub_comment_count" VARCHAR(16) NOT NULL /* 评论回复数 */ -) /* 微博帖子评论 */; -CREATE INDEX IF NOT EXISTS "idx_weibo_note__comment_c7611c" ON "weibo_note_comment" ("comment_id"); -CREATE INDEX IF NOT EXISTS "idx_weibo_note__note_id_24f108" ON "weibo_note_comment" ("note_id"); -CREATE INDEX IF NOT EXISTS "idx_weibo_note__create__667fe3" ON "weibo_note_comment" ("create_date_time"); -CREATE TABLE IF NOT EXISTS "weibo_note" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "gender" VARCHAR(12) /* 用户性别 */, - "profile_url" VARCHAR(255) /* 用户主页地址 */, - "ip_location" VARCHAR(32) DEFAULT '发布微博的地理信息', - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "note_id" VARCHAR(64) NOT NULL /* 帖子ID */, - "content" TEXT /* 帖子正文内容 */, - "create_time" BIGINT NOT NULL /* 帖子发布时间戳 */, - "create_date_time" VARCHAR(32) NOT NULL /* 帖子发布日期时间 */, - "liked_count" VARCHAR(16) /* 帖子点赞数 */, - "comments_count" VARCHAR(16) /* 帖子评论数量 */, - "shared_count" VARCHAR(16) /* 帖子转发数量 */, - "note_url" VARCHAR(512) /* 帖子详情URL */ -) /* 微博帖子 */; -CREATE INDEX IF NOT EXISTS "idx_weibo_note_note_id_f95b1a" ON "weibo_note" ("note_id"); -CREATE INDEX IF NOT EXISTS "idx_weibo_note_create__692709" ON "weibo_note" ("create_time"); -CREATE INDEX IF NOT EXISTS "idx_weibo_note_create__d05ed2" ON "weibo_note" ("create_date_time");""" - - -async def downgrade(db: BaseDBAsyncClient) -> str: - return """ - """ diff --git a/migrations/models/1_20240302150145_create_creator_and_add_video_url_for_xhs.py b/migrations/models/1_20240302150145_create_creator_and_add_video_url_for_xhs.py deleted file mode 100644 index 71092c7..0000000 --- a/migrations/models/1_20240302150145_create_creator_and_add_video_url_for_xhs.py +++ /dev/null @@ -1,29 +0,0 @@ -from tortoise import BaseDBAsyncClient - - -async def upgrade(db: BaseDBAsyncClient) -> str: - return """ - ALTER TABLE "xhs_note" ADD "video_url" TEXT /* 视频地址 */; - ALTER TABLE "xhs_note" ADD "tag_list" TEXT /* 标签列表 */; - CREATE TABLE IF NOT EXISTS "xhs_creator" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL /* 自增ID */, - "user_id" VARCHAR(64) NOT NULL /* 用户ID */, - "nickname" VARCHAR(64) /* 用户昵称 */, - "avatar" VARCHAR(255) /* 用户头像地址 */, - "ip_location" VARCHAR(255) /* 评论时的IP地址 */, - "add_ts" BIGINT NOT NULL /* 记录添加时间戳 */, - "last_modify_ts" BIGINT NOT NULL /* 记录最后修改时间戳 */, - "desc" TEXT /* 用户描述 */, - "gender" VARCHAR(1) /* 性别 */, - "follows" VARCHAR(16) /* 关注数 */, - "fans" VARCHAR(16) /* 粉丝数 */, - "interaction" VARCHAR(16) /* 获赞和收藏数 */, - "tag_list" TEXT /* 标签列表 */ -) /* 小红书博主 */;""" - - -async def downgrade(db: BaseDBAsyncClient) -> str: - return """ - ALTER TABLE "xhs_note" DROP COLUMN "video_url"; - ALTER TABLE "xhs_note" DROP COLUMN "tag_list"; - DROP TABLE IF EXISTS "xhs_creator";""" diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index e0d105b..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,4 +0,0 @@ -[tool.aerich] -tortoise_orm = "db.TORTOISE_ORM_CONFIG" -location = "./migrations" -src_folder = "./."