Alembic: Updates the creation of a default column
@@ -18,7 +18,9 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
- op.add_column('base_result', sa.Column('protocols', postgresql.JSONB(astext_type=sa.Text()), nullable=False), default=lambda: {})
+ op.add_column('base_result', sa.Column('protocols', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
+ op.execute("UPDATE base_result SET protocols='{}'::json")
+ op.alter_column('base_result', 'protocols', nullable=False)
op.add_column('result', sa.Column('wavefunction', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
# ### end Alembic commands ###
