Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2016-03-08 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by akki):

 * cc: aksheshdoshi@… (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.fc9f8fe14a87c6b1d44c41128d0dbbcc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2016-02-03 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by lwm):

 Replying to [comment:8 ris]:
 > Replying to [comment:4 tomviner]:
 > > I've found an associated case where a field with {{{db_index=True}}},
 is renamed, and another db_indexed field created with the original's name.
 >
 > FWIW I have worked around this in my migrations by doing two
 AlterFields, dropping & re-creating the index by doing db_index=False then
 db_index=True.

 Confirmed. This worked for me also. I can use `manage.py sqlmigrate 
 ` to see which indexes are giving me conflicts (should be the
 same as the error you get when you try to run migrate) and then used the
 `db_index=False/True` trick with `AlterField`.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.7ccda12942a9e5f514c66cb573986e7f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2016-01-08 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by evenicoulddoit):

 I tried to migrate to a new model and bumped into this one. To fix, I made
 sure that I renamed my existing model to "old" first (e.g.
 Model->ModelOld), create the new model with the previous name (e.g.
 Model), migrate the data and then remove the old model. My previous
 strategy of creating the new table migrating the data and then renaming it
 broke due to the index issues.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.c4069abc15582ececfa8b942ff0b2114%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2015-11-13 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by skyjur):

 This also happens when renaming a ManyToManyField and then adding a new
 ManyToManyField with the same name. I've opened a ticket then @timgraham
 pointed out that it's duplicate of this one
 https://code.djangoproject.com/ticket/25752

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.cd4b6a23899a90202fe5d56470a15068%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-12-18 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by ris):

 Replying to [comment:4 tomviner]:
 > I've found an associated case where a field with {{{db_index=True}}}, is
 renamed, and another db_indexed field created with the original's name.

 FWIW I have worked around this in my migrations by doing two AlterFields,
 dropping & re-creating the index by doing db_index=False then
 db_index=True.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.3ce71dfa7486f688937b4fe28b2c2839%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-12-18 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by ris):

 * cc: bugs@… (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.837b75f843e7ad12bdc4a089c6ce804e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-12-01 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by tomviner):

 * owner:  tomviner =>
 * status:  assigned => new


Comment:

 After [https://groups.google.com/forum/#!topic/django-
 developers/7pMxh2JF1lo a discussion on django-dev] it makes sense to leave
 the resolution of this issue to
 [https://github.com/django/deps/blob/indexes/drafts/indexes.rst Marc
 Tamlyn's Advanced indexes DEP], which he says will involve user
 specified/reproducible index names, as well as index renaming.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.03bbe1b52064cc5f06dc251a081d961c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-11-15 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:  tomviner
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by tomviner):

 I've added a schema test case:
 https://github.com/tomviner/django/compare/ticket/23577

 This should currently fail on all backends except sqlite (which doesn't
 rename fields - it drop/creates the whole table). When this bug is fixed,
 it should pass for all backends, for that reason I haven't added any
 unittest.skip decorator.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.0987b77a13b7faa587861656df99fc67%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-11-15 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:  tomviner
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by tomviner):

 I've found an associated case where a field with {{{db_index=True}}}, is
 renamed, and another db_indexed field created with the original's name.

 Just discussed this with @andrewgodwin, I've agreed to write a test case
 for the field rename case, and then post about a solution on django-dev,
 with his preference being to make index names randomised.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.71c7afb6862515276e71d3866f84b988%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-11-15 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:  tomviner
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by tomviner):

 * owner:  nobody => tomviner
 * status:  new => assigned


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.425f1d72de4b9675a00cdd1fe020b545%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-09-30 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by charettes):

 * stage:  Unreviewed => Accepted


Comment:

 Haven't reproduced but the issue seems legit from the report.

 I guess the `RenameModel` operation should also rename indexes generated
 from the original model name.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.ca88f2c250aaf490f612c411d7e05fee%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-09-30 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+--
 Reporter:  CrimsonZen  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by CrimsonZen):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 It is worth noting that if you use postgres instead, the error is
 `django.db.utils.ProgrammingError: relation "sample_foo_4350f7d0" already
 exists`.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.4acb0d9f519adf249bf2d1601baa3a9e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #23577: CREATE INDEX-related OperationalError on migrating renamed models with colliding field names

2014-09-30 Thread Django
#23577: CREATE INDEX-related OperationalError on migrating renamed models with
colliding field names
+
 Reporter:  CrimsonZen  |  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Migrations  |Version:  1.7
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+
 This one's a bit of an edge case, but I ran into it trying to refactor
 some models on my moderately large work project.

 Let's say I have a Django 1.7 app called `sample`:
 1. Create a model `Bar`.
 2. Create a model `Foo` with `bar = models.ForeignKey(Bar, blank=True,
 null=True)`
 3. `makemigrations` (migration `0001`)
 4. Rename `Foo` to `OldFoo`.
 5. `makemigrations`, say yes to the rename prompt (migration `0002`)
 6. Create new model `Foo`, which also has `bar = models.ForeignKey(Bar,
 blank=True, null=True)`
 7. `makemigrations` (migration `0003`)
 8. `migrate`

 When `migrate` hits `0003`, it throws this error:
 {{{django.db.utils.OperationalError: index sample_foo_4350f7d0 already
 exists}}}

 You may notice that `sqlmigrate sample 0001` and `sqlmigrate sample 0003`
 have the same line in both of them:
 {{{CREATE INDEX sample_foo_4350f7d0 ON "sample_foo" ("bar_id");}}}


 In my production case, I actually had no problems on servers, because
 South had created the index with a different name.  When I renamed the
 models and added a field, the new index did not collide with the old one.
 However, our test suite started failing, because it would run the
 migrations from the ground up, exposing the above bug.

 I haven't decided on a workaround yet, but I thought I'd bring this to
 your attention.  I might have to inject a migration that renames the index
 created in `0001`, or something to that effect.

 The attached test case has a project `dj17test` in the state after having
 performed all of the above steps.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.7c7faaadd490661c6464c4245a89af32%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.