collabrix/scripts/add_snippets_enabled_to_department.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

41 lines
928 B
Python

#!/usr/bin/env python3
"""
Add snippets_enabled column to department table
"""
import psycopg2
def main():
# Database connection details
db_config = {
'host': '192.168.0.19',
'database': 'OfficeDesk',
'user': 'postgres',
'password': 'your_password'
}
try:
# Connect to database
conn = psycopg2.connect(**db_config)
cursor = conn.cursor()
# Add snippets_enabled column
cursor.execute("""
ALTER TABLE department
ADD COLUMN IF NOT EXISTS snippets_enabled BOOLEAN DEFAULT TRUE;
""")
print("✅ snippets_enabled column added to department table!")
# Commit changes
conn.commit()
cursor.close()
conn.close()
except Exception as e:
print(f"❌ Error: {e}")
return
if __name__ == "__main__":
main()