forked from fossasia/open-event-server
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Migration for changing gender type (fossasia#6117)
- Loading branch information
1 parent
68d8dfc
commit 05b9e17
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
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,25 @@ | ||
"""Changing field type of gender from `Text` to `Select` | ||
Revision ID: 43e8c59337af | ||
Revises: b2aca7268345 | ||
Create Date: 2019-06-27 20:31:58.92665 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
import sqlalchemy_utils | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '43e8c59337af' | ||
down_revision = 'b2aca7268345' | ||
|
||
|
||
def upgrade(): | ||
op.execute("UPDATE custom_forms SET type = 'select' where field_identifier = 'gender' and form = 'attendee';", execution_options=None) | ||
|
||
|
||
|
||
def downgrade(): | ||
op.execute("UPDATE custom_forms SET type = 'text' where field_identifier = 'gender' and form = 'attendee';", execution_options=None) |