#!/usr/bin/env python3
"""
Migration script to add acknowledged flags to pvp_combats table
"""
import asyncio
from api.database import DatabaseSession, pvp_combats
from sqlalchemy import text

async def migrate():
    """Add attacker_acknowledged and defender_acknowledged columns"""
    async with DatabaseSession() as session:
        # Add attacker_acknowledged column
        await session.execute(text(
            "ALTER TABLE pvp_combats ADD COLUMN IF NOT EXISTS attacker_acknowledged BOOLEAN DEFAULT FALSE"
        ))
        
        # Add defender_acknowledged column
        await session.execute(text(
            "ALTER TABLE pvp_combats ADD COLUMN IF NOT EXISTS defender_acknowledged BOOLEAN DEFAULT FALSE"
        ))
        
        await session.commit()
        print("✅ Added attacker_acknowledged and defender_acknowledged columns to pvp_combats table")

if __name__ == "__main__":
    asyncio.run(migrate())
