Files
KCGL/inventory-backend/init_db.py

10 lines
210 B
Python

from app import create_app, db
# 1. 创建应用实例
app = create_app()
# 2. 在应用上下文中创建表
with app.app_context():
db.create_all()
print("✅ 数据库表结构已成功创建!")