compare_server_default
doesn't work with a string column that contains a backslash in its default value
#1145
Labels
Describe the bug
If
server_default
of a string column contains a backslash, alembic generatesop.alter_column
migration despite the fact that the database and model are consistent.Expected behavior
If the database and model are consistent,
alembic revision --autogenerate
should create an empty migration.To Reproduce
mymodel.py
:alembic init alembic
compare_server_default
toTrue
inenv.py
env.py
:alembic revision --autogenerate
. It created the following migration:alembic upgrade head
alembic revision --autogenerate
again.Error
The last
alembic revision --autogenerate
creates a non-empty migration file:Due to a bug it generates a non-empty migration:
The problem happens only if there is
\
in the default string.Versions.
Additional context
The text was updated successfully, but these errors were encountered: