Giter VIP home page Giter VIP logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
This is a Django bug caused by a MySQL limitation:
http://code.djangoproject.com/ticket/2495

Basically, MySQL's complaining because it won't let you index a whole BLOB. The
workaround is to leave the UNIQUE off and add the index later using an ALTER 
table
command. 

Original comment by [email protected] on 7 Oct 2008 at 3:54

from django-survey.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
This should already be fixed (thank to brosner)

Original comment by [email protected] on 17 Oct 2008 at 4:29

  • Changed state: Fixed

from django-survey.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
oops, confused this with something else.
This issue has yet to be fixed in django.
I am still not comfortable marking the text field non-unique.

Original comment by [email protected] on 17 Oct 2008 at 4:33

  • Changed state: New

from django-survey.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
Still a problem with MySQL that should be fixed in the DJango cod, but hasn't 
been. 
Problem has been around since Jun 2008

Comment out the unique_together(...) call, syncdb, then turn it back on.....

Can't find any docs on unique_together, but if you could specify a keylength, 
maybe
this could be fixed here.....

Original comment by [email protected] on 27 Dec 2008 at 7:14

from django-survey.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
This problem still exists.  I followed the approach from mandric in the original
post--that is, I changed the TextField to a CharField with a max_length of 500.

Original comment by [email protected] on 28 Aug 2009 at 3:53

from django-survey.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
it is needed to limit UNIQUE keys like that:
    UNIQUE (`survey_id`, `text`(100))

Original produces 
    UNIQUE (`survey_id`, `text`)
and mysql does not allow UNIQUE keys more than 1000 byte.

Modified sql is attached. Or do like that

$ /manage.py sqlall survey > survey.sql

and open and change lines below in survey.sql

    UNIQUE (`survey_id`, `text`)
to
    UNIQUE (`survey_id`, `text`(100))

and

    UNIQUE (`question_id`, `text`)
to
    UNIQUE (`question_id`, `text`(100))

and save survey.sql and execute this file with your mysql client app on your 
database.

Original comment by [email protected] on 10 Mar 2010 at 11:24

Attachments:

from django-survey.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
Hey ... why I'm still having this problem ?

Original comment by [email protected] on 4 Jul 2011 at 3:59

from django-survey.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
Hey ... why I'm still having this problem ?

Original comment by [email protected] on 4 Jul 2011 at 3:59

from django-survey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.