CoolFace
Apppublic

Ahmed-Raza/phase-3-backend

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
add_name_column.py16 linesDownload Raw Back to root
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()