import sqlite3
conn = sqlite3.connect("data.sqlite")
cur = conn.cursor()
cols = [r[1] for r in cur.execute("PRAGMA table_info(support_messages)")]
print("existing columns:", cols)
if "sender_id" not in cols:
    cur.execute('ALTER TABLE support_messages ADD COLUMN sender_id INTEGER')
    cur.execute('ALTER TABLE support_messages ADD COLUMN is_admin_reply BOOLEAN DEFAULT 0')
    conn.commit()
    print("added sender_id and is_admin_reply")
else:
    print("columns already exist")
conn.close()