#!/usr/bin/env python3 """Add profile_picture column to user table""" import sys sys.path.insert(0, '/home/OfficeDesk/backend') import psycopg2 def main(): # Connect to database conn = psycopg2.connect('postgresql://postgres:your_password@192.168.0.19/OfficeDesk') cur = conn.cursor() try: # Check if column already exists cur.execute(""" SELECT column_name FROM information_schema.columns WHERE table_name='user' AND column_name='profile_picture' """) if cur.fetchone(): print("✓ Column 'profile_picture' already exists") else: # Add profile_picture column cur.execute(""" ALTER TABLE "user" ADD COLUMN profile_picture VARCHAR """) conn.commit() print("✓ Added 'profile_picture' column to user table") except Exception as e: conn.rollback() print(f"❌ Error: {e}") return 1 finally: cur.close() conn.close() return 0 if __name__ == "__main__": sys.exit(main())