13 lines
464 B
Python
13 lines
464 B
Python
from app.database import engine
|
|
from sqlalchemy import text
|
|
|
|
def migrate():
|
|
with engine.connect() as conn:
|
|
conn.execute(text("ALTER TABLE questions ADD COLUMN IF NOT EXISTS question_type VARCHAR(20) DEFAULT 'text'"))
|
|
conn.execute(text("ALTER TABLE questions ADD COLUMN IF NOT EXISTS options TEXT NULL"))
|
|
conn.commit()
|
|
print("Migration successful: added question_type and options columns.")
|
|
|
|
if __name__ == "__main__":
|
|
migrate()
|