You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
buffer_platform/init_analysis_db.py

25 lines
705 B

"""
手动初始化期货智析数据库
用于在应用外部创建数据库表
"""
import sys
from pathlib import Path
# 添加项目根目录到 Python 路径
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
from app.analysis_db import init_analysis_db
if __name__ == "__main__":
print("开始初始化期货智析数据库...")
init_analysis_db()
print("✅ 数据库初始化完成!")
# 验证数据库文件是否创建
from app.analysis_db import ANALYSIS_DB_PATH
if ANALYSIS_DB_PATH.exists():
print(f"✅ 数据库文件已创建: {ANALYSIS_DB_PATH}")
else:
print(f"❌ 数据库文件未创建: {ANALYSIS_DB_PATH}")