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