Skip to content

Commit

Permalink
Fix migration issue PowerDNS-Admin#635 as proposed by @keesbos
Browse files Browse the repository at this point in the history
  • Loading branch information
subbink committed Mar 5, 2023
1 parent 5f2fc51 commit fcda497
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
def upgrade():
with op.batch_alter_table('user') as batch_op:
batch_op.add_column(
sa.Column('confirmed', sa.Boolean(), nullable=False,
sa.Column('confirmed', sa.Boolean(), nullable=True,
default=False))
with op.batch_alter_table('user') as batch_op:
user = sa.sql.table('user', sa.sql.column('confirmed'))
batch_op.execute(user.update().values(confirmed=False))
batch_op.alter_column('confirmed', nullable=False)


def downgrade():
Expand Down

0 comments on commit fcda497

Please sign in to comment.