Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrm500 committed Feb 24, 2025
1 parent 27d8c22 commit cf2df61
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions remove_dummy_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from app.create_app import create_app
from app.db import db
from app.db.models.fund import Fund
from app.db.models.round import Round
Expand Down Expand Up @@ -80,12 +81,14 @@ def delete_rounds():


if __name__ == "__main__":
try:
# Delete rounds first to avoid foreign key constraints
delete_rounds()
# Then delete funds
delete_funds()
print("\n✓ Deletion process completed")
except Exception as e:
print(f"\n❌ Fatal error during deletion process: {str(e)}")
db.session.rollback()
app = create_app() # Create the Flask app
with app.app_context(): # Create application context
try:
# Delete rounds first to avoid foreign key constraints
delete_rounds()
# Then delete funds
delete_funds()
print("\n✓ Deletion process completed")
except Exception as e:
print(f"\n❌ Fatal error during deletion process: {str(e)}")
db.session.rollback()

0 comments on commit cf2df61

Please sign in to comment.