Merge db-migrations: Add Flask-Migrate support and clean up old migration system
This commit is contained in:
16
apply_migration.py
Normal file
16
apply_migration.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
"""Apply database migrations with Flask-Migrate"""
|
||||
|
||||
from flask_migrate import upgrade
|
||||
from app import app, db
|
||||
|
||||
if __name__ == '__main__':
|
||||
with app.app_context():
|
||||
print("Applying migrations...")
|
||||
try:
|
||||
upgrade()
|
||||
print("Migrations applied successfully!")
|
||||
except Exception as e:
|
||||
print(f"Error applying migrations: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
Reference in New Issue
Block a user