Ahmed-Raza/phase-3-backend
0
1from sqlalchemy import text
2from database import engine
3
4def add_name_column():
5 with engine.connect() as conn:
6 try:
7 # Add the name column
8 conn.execute(text('ALTER TABLE "user" ADD COLUMN name VARCHAR NOT NULL DEFAULT \'\''))
9 conn.commit()
10 print("Column 'name' added successfully!")
11 except Exception as e:
12 print(f"Error: {e}")
13 print("Column might already exist or there's another issue.")
14
15if __name__ == "__main__":
16 add_name_column()