collabrix/scripts/add_reply_to_messages.py
DGSoft 93b98cfb5c Initial commit: Team Chat System with Code Snippet Library
- Complete chat application similar to Microsoft Teams
- Code snippet library with syntax highlighting
- Real-time messaging with WebSockets
- File upload with Office integration
- Department-based permissions
- Dark/Light theme support
- Production deployment with SSL/Reverse Proxy
- Docker containerization
- PostgreSQL database with SQLModel ORM
2025-12-09 22:25:03 +01:00

29 lines
801 B
Python

#!/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()