You can pass the parameter recreate="always"
to the method batch_alter_column
so that a new table is created and the old one is deleted. This way, you won't have problems with prior constraints. This can be helpful with the migrations of not so big tables (as otherwise the performance would be bad). Check Alembic's docs here.