| 123456789101112131415 |
- """CLI: ``python -m supply_infra.db`` 初始化数据库表。"""
- from supply_infra.config import get_infra_settings
- from supply_infra.db import init_db
- if __name__ == "__main__":
- settings = get_infra_settings()
- result = init_db()
- print(
- f"Database ready: {settings.mysql_host}:{settings.mysql_port}/{settings.mysql_database}"
- )
- if result["created"]:
- print("Created tables:", ", ".join(result["created"]))
- else:
- print("No new tables created (all ORM tables already exist).")
|