-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/549 response tracking (#641)
* Track user quiz question responses. * Update tests.
- Loading branch information
1 parent
7fa0243
commit dda77ed
Showing
6 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
alembic/versions/12049328fd0a_add_results_to_quiz_completions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""add results to quiz completions | ||
Revision ID: 12049328fd0a | ||
Revises: 291331bea272 | ||
Create Date: 2024-09-11 10:23:37.753893 | ||
""" | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '12049328fd0a' | ||
down_revision = '291331bea272' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# Add the 'responses' column | ||
op.add_column('quiz_completions', sa.Column( | ||
'responses', | ||
postgresql.JSONB(astext_type=sa.Text()), | ||
nullable=False, | ||
server_default=sa.text("'{}'::jsonb") | ||
)) | ||
|
||
|
||
def downgrade(): | ||
# Remove the 'responses' column | ||
op.drop_column('quiz_completions', 'responses') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters