import db def migrate(): print("Migrating database to add dimensions column to order_files...") try: # Check if column exists first using MySQL syntax columns = db.execute_query("SHOW COLUMNS FROM order_files") column_names = [c['Field'] for c in columns] if 'dimensions' not in column_names: db.execute_commit("ALTER TABLE order_files ADD COLUMN dimensions VARCHAR(255)") print("Successfully added 'dimensions' column to 'order_files' table.") else: print("Column 'dimensions' already exists.") except Exception as e: print(f"Migration error: {e}") if __name__ == "__main__": migrate()