While maintaining a SQLAlchemy data model and utilizing alembic for version control, the following code change I made resulted in an empty revision:
some_column = Column(Boolean, nullable=False, default=False)
While previously it was:
some_column = Column(Boolean, nullable=False)
So adding a default value produces no changes in alembic, i.e. generates an empty revision. I tried other values offered by SQLAlchemy like false()
and expression.false()
instead of False
, but the result is the same (empty alembic revision). Also tried server_default
instead of default
. The database in question is PostgreSQL.
By empty revision, of course I mean that alembic doesn't recognize any change being made in SQLAlchemy:
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
Appreciate any help in this regard.