Fix exception on op.alter_column(..., server_default=None) in mysql

Declined
#21 · Created  · Last updated

Declined pull request

OK take a look at what I did in b61eccce5e45651ccdb25. im not sure about the existing_server_default=None thing, if there's some problem there that would be a separate issue, I added a9426a4ec4f14aa12c17f to test that also.

Closed by: ·2014-03-16

Description

Attempting to remove an server_default from a column in mysql, e.g.

op.alter_column('MyTable', 'mycol', server_default=None, existing_type=sa.Integer(), existing_nullable=False, existing_server_default='42')

leads to an AttributeError: 'NoneType' object has no attribute '_compiler_dispatch' exception.

As a work-around, specifying server_default=False works (but I suspect this only works under mysql since False is really supposed to mean "no change to the server_default".)

This PR includes a new test in test_mysql.py which exercises the problem.

0 attachments

0 comments

Loading commits...