from unmake import HistoryManager, SQLiteStorage

manager = HistoryManager(SQLiteStorage("migration-history.db"))

with manager.start_session(
    script="database_migration.py", migration="2026_01_add_index"
) as session:
    session.record_operation(
        "db.sql",
        {
            "description": "create users_email_idx",
            "rollback_sql": "DROP INDEX IF EXISTS users_email_idx",
        },
    )

print("Recorded migration session", session.session_id)
