import sqlite3

DB_PATH = "/app/companies_v3_fixed_2.db"

def add_column():
    try:
        conn = sqlite3.connect(DB_PATH)
        cursor = conn.cursor()
        print(f"Adding column 'strategy_briefing' to 'industries' table in {DB_PATH}...")
        cursor.execute("ALTER TABLE industries ADD COLUMN strategy_briefing TEXT;")
        conn.commit()
        print("Success.")
    except sqlite3.OperationalError as e:
        if "duplicate column name" in str(e):
            print("Column 'strategy_briefing' already exists. Skipping.")
        else:
            print(f"Error: {e}")
    except Exception as e:
        print(f"Error: {e}")
    finally:
        if conn: conn.close()

if __name__ == "__main__":
    add_column()
