-
-
Notifications
You must be signed in to change notification settings - Fork 623
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
Migration failure with Django 1.7.2 and sqlite database when using a through model. #285
Comments
…h sqlite jazzband/django-taggit#285 - pin sqlite tox tests to 1.7.1 for now
Experienced this as well, had to downgrade to 1.7.1 so I could run my tests. |
I can also confirm this issue with Taggit 0.12.2 and Django 1.7.2 |
This Django commit is the commit that broke tests for django-taggit. |
Specifically with this section # Add in any created fields
for field in create_fields:
body[field.name] = field
- # If there's a default, insert it into the copy map
- if field.has_default():
+ # Choose a default and insert it into the copy map
+ if not isinstance(field, ManyToManyField):
mapping[field.column] = self.quote_value(
self.effective_default(field)
) With Taggit 0.12.2:
|
Manytomany field can not have a default. |
@coldmind: There's difference though. With Django 1.7.1: (pdb) mapping
{u'id': u'"id"', u'name': u'"name"'} With Django 1.7.2: (pdb) mapping
{u'tags': 'NULL', u'id': u'"id"', u'name': u'"name"'} |
...and as a result, |
@frewsxcv what do you thing is wrong in my commit? It was a bug, sqlite3 not always used effective default, but it should use. |
Just checked that, migrations passed.
for |
I opened django/django#3865 anyway, because it should be in that way. |
I've created PR #286 to add the |
I just committed a patch (PR) to Django's 1.7 branch that uses the |
The issue is unfortunately still present in Django 1.7.4. |
This issue doesn't exist anymore in Django 1.7.5 (https://docs.djangoproject.com/en/1.7/releases/1.7.5/) as the regression has been fixed: https://code.djangoproject.com/ticket/24236 Edit: someone applied a patch in the project I'm working on and I overlooked that, my apologies for the false hopes. |
@outime Is that with or without the patch from #286 applied? 1.7.5 still fails with the OperationalError for me (running the unit tests for https://github.com/torchbox/wagtail under sqlite). |
This still requires #286 to be merged |
@frewsxcv I don't mind taking over maintenance as long as no one else wants to or has any objections. But, maybe commit access to this repository and the pypi project would be better so it could stay in the same place and keep its name? |
I'd like to find a way to have a maintainer under the current repo/pypi On Fri, Feb 27, 2015 at 1:22 PM, Luke Pomfrey notifications@github.com
"I disapprove of what you say, but I will defend to the death your right to |
@alex As I said I've no problem taking over maintenance, providing no one has any objections. If it helps my username is the same on pypi as here. |
I just encountered this issue on the latest version of django. I can't add any fields to a model without encountering this. I was able to get it to work yesterday on a column I added, but I'm not sure how... |
Add get_internal_type to TaggableManager for #285
#286 is now merged and released (and I can confirm it works for me) - presumably this can be closed now? |
Fixed with the merge of #286 |
I'm not entirely sure whether this is an issue with taggit or Django itself, but since I can only reproduce it with taggit I'm reporting it here. Feel free to close as a Django issue if you think this isn't anything to do with taggit.
When using a through model with taggit and Django 1.7.2, migrations always fail with an OperationalError. This only occurs (as far as I know) with the sqlite backend, PostgreSQL, at least, is fine.
To reproduce
Create a simple project with an app with the following
models.py
Make your initial migrations with
manage.py makemigrations <appname>
then run withmanage.py migrate
.The
migrate
command will fail with an exception like:The SQL causing the issue is:
Django 1.7.1 doesn't exhibit the issue, and it's present in both the develop branch of taggit and the latest, 0.12.2, release.
The text was updated successfully, but these errors were encountered: