Skip to content

Commit

Permalink
Refactor a migration to avoid server default for BDR.
Browse files Browse the repository at this point in the history
fixes #1519

Signed-off-by: Randy Barlow <[email protected]>
  • Loading branch information
bowlofeggs committed Jun 1, 2017
1 parent 05ab85a commit 7aa2959
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

def upgrade():
"""Add the type column to the builds table."""
# The default of ``1`` is the RPM Build type.
op.add_column('builds', sa.Column('type', sa.Integer(), nullable=False, server_default=u'1'))
op.alter_column('builds', 'type', server_default=None)
builds = sa.sql.table('builds', sa.sql.column('type', sa.Integer()))
op.add_column('builds', sa.Column('type', sa.Integer(), nullable=True))
# The type 1 is the RPM Build type.
op.execute(builds.update().values({'type': 1}))
op.alter_column('builds', 'type', nullable=False)


def downgrade():
Expand Down

0 comments on commit 7aa2959

Please sign in to comment.