Feature: Support both Free-Text and Multiple-Choice question types

This commit is contained in:
kobold-ai
2026-09-21 11:35:39 +02:00
parent c3a21369ef
commit 58959ca881
13 changed files with 448 additions and 47 deletions
+12
View File
@@ -0,0 +1,12 @@
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()