-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from mitmedialab/dsjen/tidy-models
Remove political registration from user model, echo_range from settings
- Loading branch information
Showing
3 changed files
with
32 additions
and
21 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
migrations/versions/1266f69d6574_remove_politics_registration.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,29 @@ | ||
""" | ||
Removes politics registration from user model and echo range from settings | ||
Revision ID: 1266f69d6574 | ||
Revises: 8fe786843072 | ||
Create Date: 2019-04-24 11:12:10.724450 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '1266f69d6574' | ||
down_revision = '8fe786843072' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.drop_column('user_settings', 'echo_range') | ||
op.drop_column('users', 'political_affiliation') | ||
op.drop_column('users', 'completed_registration') | ||
|
||
|
||
def downgrade(): | ||
op.add_column('users', sa.Column('completed_registration', sa.BOOLEAN(), autoincrement=False, nullable=True)) | ||
op.add_column('users', sa.Column('political_affiliation', postgresql.ENUM(u'left', u'center_left', u'center', u'center_right', u'right', name='politicsenum'), autoincrement=False, nullable=True)) | ||
op.add_column('user_settings', sa.Column('echo_range', postgresql.ENUM(u'narrow', u'mid_narrow', u'mid', u'mid_wide', u'wide', name='echorangeenum'), autoincrement=False, nullable=True)) |
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