#!/usr/bin/env python3 """Add reply_to_id column to message and direct_message tables""" import psycopg2 def main(): conn = psycopg2.connect('postgresql://postgres:your_password@192.168.0.19/OfficeDesk') cur = conn.cursor() print("Adding reply_to_id column to message table...") cur.execute(''' ALTER TABLE message ADD COLUMN IF NOT EXISTS reply_to_id INTEGER REFERENCES message(id) ''') print("Adding reply_to_id column to direct_message table...") cur.execute(''' ALTER TABLE direct_message ADD COLUMN IF NOT EXISTS reply_to_id INTEGER REFERENCES direct_message(id) ''') conn.commit() print("✅ Reply columns added successfully!") cur.close() conn.close() if __name__ == "__main__": main()