Skip to content

Commit 87a6159

Browse files
sethbernCopilot
andauthored
Update migrations/versions/c1d2e3f4a5b6_add_use_llm_to_assignment_questions.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5cdee00 commit 87a6159

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

migrations/versions/c1d2e3f4a5b6_add_use_llm_to_assignment_questions.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@
1818

1919

2020
def upgrade() -> None:
21-
#Add use_llm column to assignment_questions table as nullable
22-
#controls whether a peer instruction question uses an LLM peer for async mode
23-
op.add_column('assignment_questions',
24-
sa.Column('use_llm', sa.String(length=1), nullable=True)
21+
# Add use_llm column to assignment_questions table.
22+
# Controls whether a peer instruction question uses an LLM peer for async mode.
23+
op.add_column(
24+
'assignment_questions',
25+
sa.Column(
26+
'use_llm',
27+
sa.String(length=1),
28+
nullable=True,
29+
server_default=sa.text("'F'"),
30+
),
2531
)
32+
op.execute("UPDATE assignment_questions SET use_llm = 'F' WHERE use_llm IS NULL")
33+
op.alter_column('assignment_questions', 'use_llm', nullable=False)
2634

2735

2836
def downgrade() -> None:

0 commit comments

Comments
 (0)