tmp_update_orders_notes.py 510 B

1234567891011121314151617
  1. from backend.db import execute_commit
  2. def migrate():
  3. print("Migrating orders table...")
  4. try:
  5. execute_commit("ALTER TABLE orders ADD COLUMN quantity INT DEFAULT 1")
  6. except Exception as e:
  7. print(f"Quantity column might already exist: {e}")
  8. try:
  9. execute_commit("ALTER TABLE orders ADD COLUMN notes TEXT")
  10. except Exception as e:
  11. print(f"Notes column might already exist: {e}")
  12. print("Migration complete!")
  13. if __name__ == "__main__":
  14. migrate()