alembic check crashes in the presence of a diff (e.g. a view created):
...
File ".../alembic/command.py", line 297, in check
diffs = migration_script.upgrade_ops.as_diffs()
File ".../alembic/operations/ops.py", line 2547, in as_diffs
return list(OpContainer._ops_as_diffs(self))
File ".../alembic/operations/ops.py", line 2557, in _ops_as_diffs
yield op.to_diff_tuple()
File "...alembic/operations/ops.py", line 87, in to_diff_tuple
raise NotImplementedError
NotImplementedError
The problem being that ReversibleOp doesn't currently implement MigrateOperation's abstract method to_diff_tuple, which is used to render a diff to the console.
alembic check
crashes in the presence of a diff (e.g. a view created):The problem being that
ReversibleOp
doesn't currently implementMigrateOperation
's abstract methodto_diff_tuple
, which is used to render a diff to the console.Env:
I've patched over it for now with the following added method:
And it works fine:
Feel free to use the code provided here in alembic_utils if applicable.