ems-core v1.0.0: Standard EMS platform core
Shared backend + frontend for multi-customer EMS deployments. - 12 enterprise modules: quota, cost, charging, maintenance, analysis, etc. - 120+ API endpoints, 37 database tables - Customer config mechanism (CUSTOMER env var + YAML config) - Collectors: Modbus TCP, MQTT, HTTP API, Sungrow iSolarCloud - Frontend: React 19 + Ant Design + ECharts + Three.js - Infrastructure: Redis cache, rate limiting, aggregation engine Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
18
scripts/init_db.py
Normal file
18
scripts/init_db.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""数据库初始化 - 创建所有表"""
|
||||
import asyncio
|
||||
import sys
|
||||
sys.path.insert(0, "../backend")
|
||||
|
||||
from app.core.database import engine, Base
|
||||
from app.models import * # noqa: F401, F403
|
||||
|
||||
|
||||
async def init():
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
print("All tables created successfully!")
|
||||
await engine.dispose()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(init())
|
||||
Reference in New Issue
Block a user