Initial commit
This commit is contained in:
17
migrate_db.py
Normal file
17
migrate_db.py
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
資料庫遷移腳本 - 添加 DepartmentCapability 表
|
||||
"""
|
||||
|
||||
from simple_app import app, db, DepartmentCapability
|
||||
|
||||
def migrate():
|
||||
with app.app_context():
|
||||
# 創建新表(如果不存在)
|
||||
db.create_all()
|
||||
print("✓ 資料庫表已更新")
|
||||
print("✓ DepartmentCapability 表已創建")
|
||||
|
||||
if __name__ == '__main__':
|
||||
migrate()
|
||||
print("\n資料庫遷移完成!")
|
||||
Reference in New Issue
Block a user