Spaces:
Running
Running
| import psycopg2 | |
| DATABASE_URL = "postgresql://postgres.egkydqberhebzkqtltic:Isaac%23105*may%40@aws-1-us-east-1.pooler.supabase.com:5432/postgres" | |
| def fix_schema(): | |
| conn = psycopg2.connect(DATABASE_URL) | |
| cur = conn.cursor() | |
| print("Agregando is_premium a users...") | |
| try: | |
| cur.execute("ALTER TABLE users ADD COLUMN is_premium BOOLEAN DEFAULT FALSE;") | |
| conn.commit() | |
| print("OK.") | |
| except Exception as e: | |
| print("Error o ya existe:", e) | |
| conn.rollback() | |
| cur.close() | |
| conn.close() | |
| if __name__ == "__main__": | |
| fix_schema() | |