Fix migration issue #635 as proposed by @keesbos

This commit is contained in:
Stefan Ubbink 2023-03-05 11:01:17 +01:00
parent 5f2fc514df
commit fcda4977e2

View File

@ -18,8 +18,12 @@ depends_on = None
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():