Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop personal_email column #42

Merged
merged 2 commits into from Jun 7, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -42,7 +42,6 @@ class Ethnicity(db.Model):

class Candidate(db.Model):
id = db.Column(db.Integer, primary_key=True)
personal_email = db.Column(db.String(120), unique=True)
joining_date = db.Column(db.Date())
completed_fast_stream = db.Column(db.Boolean())
first_name = db.Column(db.String(128))
@@ -0,0 +1,33 @@
"""Drop personal_email column now it is safe to do so
Revision ID: 0bcdc20a2c99
Revises: 2115ecb81393
Create Date: 2019-06-07 18:30:35.515565
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '0bcdc20a2c99'
down_revision = '2115ecb81393'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('candidate_personal_email_key', 'candidate', type_='unique')
op.drop_column('candidate', 'personal_email')
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('candidate', sa.Column('personal_email', sa.VARCHAR(length=120), autoincrement=False, nullable=True))
op.create_unique_constraint('candidate_personal_email_key', 'candidate', ['personal_email'])
op.execute(
"UPDATE candidate SET personal_email = email_address"
)
# ### end Alembic commands ###
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.