Inspectdb with type varchar(max) will set max_length to 2147483647
A field of MSSQL type
varchar with length
max will convert to a python field of type
max_length=2147483647 (on 32-bit python).
This behavior breaks subsequent runs of syncdb. MSSQL will complain:
DatabaseError: (-2147352567, 'Exception occurred.', (0, u'Microsoft SQL Server Native Client 10.0', u"The size (2147483647) given to the column 'EMAIL' exceeds the maximum allowed for any data type (8000).", None, 0, -2147217900), None)
I'm guessing it's server dependent. However, sometimes it says the max is 8000, sometimes 4000, even on the same server with seemingly the same field configurations.
Not sure what the ideal solution would be since the
max_length parameter expects a positive integer, so
'max' cannot be passed in.