Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL Incompatibility: unique_together constraint on BLOB #14

Open
matthewwithanm opened this issue Mar 6, 2011 · 2 comments
Open

MySQL Incompatibility: unique_together constraint on BLOB #14

matthewwithanm opened this issue Mar 6, 2011 · 2 comments

Comments

@matthewwithanm
Copy link

The Post model contains a unique_together constraint with includes the (BLOB) guid field, making it MySQL incompatible. Running syncdb results in the following error:

_mysql_exceptions.OperationalError: (1170, "BLOB/TEXT column 'text' used in key specification without a key length")

I was going to submit a patch, but I'm not sure how you want to handle this. Clearly, the easiest thing would be to just remove the constraint, however another option is to store a hash of the guid and use that for the unique_together tuple instead.

Here's some more information about this particular limitation.

@kouroshshafi
Copy link

when I want to migrate from my own initially schemma I have the same problem.

@kouroshshafi
Copy link

A work-around is to use CharField instead of TextField on guid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants