Spaces:
Running
Running
| import sqlite3 | |
| import os | |
| db_path = "c:/mfmm/MelodixAPI/musical_master.db" | |
| def migrate(): | |
| if not os.path.exists(db_path): | |
| print("Base de datos no encontrada.") | |
| return | |
| conn = sqlite3.connect(db_path) | |
| cursor = conn.cursor() | |
| try: | |
| cursor.execute("ALTER TABLE iglesias ADD COLUMN requiere_aprobacion BOOLEAN DEFAULT 0") | |
| print("Columna 'requiere_aprobacion' agregada a iglesias") | |
| except sqlite3.OperationalError as e: | |
| print(f"Error en iglesias (puede que ya exista): {e}") | |
| conn.commit() | |
| conn.close() | |
| print("Migración de base de datos terminada.") | |
| if __name__ == "__main__": | |
| migrate() | |