Re: [Django] #26208: Squashing migrations in which unique=True is added and then removed for Charfield cannot migrate backwards on Postgres

2016-02-12 Thread Django
#26208: Squashing migrations in which unique=True is added and then removed  for
Charfield cannot migrate backwards on Postgres
-+-
 Reporter:  linuss   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  migrations squash| Triage Stage:
  charfield unique   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => needsinfo


--
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/064.f00b0797a0a386ea44cf000aa2c17b2c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26208: Squashing migrations in which unique=True is added and then removed for Charfield cannot migrate backwards on Postgres

2016-02-11 Thread Django
#26208: Squashing migrations in which unique=True is added and then removed  for
Charfield cannot migrate backwards on Postgres
-+-
 Reporter:  linuss   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  migrations squash| Triage Stage:
  charfield unique   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

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


Comment:

 I followed those steps but couldn't reproduce. Could list the exact
 commands for each step to ensure I didn't misinterpret?

--
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/064.fb2dd0eecba1a97e267f2bb00863b085%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26208: Squashing migrations in which unique=True is added and then removed for Charfield cannot migrate backwards on Postgres

2016-02-11 Thread Django
#26208: Squashing migrations in which unique=True is added and then removed  for
Charfield cannot migrate backwards on Postgres
--+
 Reporter:  linuss|  Owner:  nobody
 Type:  Bug   | Status:  new
Component:|Version:  1.9
  Migrations  |
 Severity:  Normal|   Keywords:  migrations squash charfield unique
 Triage Stage:|  Has patch:  0
  Unreviewed  |
Easy pickings:  0 |  UI/UX:  0
--+
 This bug can be reproduced as follows:
 * Create a model with a CharField with unique=True
 * Create a migration
 * Alter the model so that CharField is no longer unique
 * Create a new migration
 * Squash the two migrations
 * Migrate forwards, and then backwards

 Error output:
 {{{
 psycopg2.ProgrammingError: relation
 "survey_respondent_email_b0f1dc87_like" already exists


 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "./manage.py", line 10, in 
 execute_from_command_line(sys.argv)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/core/management/__init__.py", line 353, in
 execute_from_command_line
 utility.execute()
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/core/management/__init__.py", line 345, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/core/management/base.py", line 348, in run_from_argv
 self.execute(*args, **cmd_options)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/core/management/base.py", line 399, in execute
 output = self.handle(*args, **options)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/core/management/commands/migrate.py", line 200, in
 handle
 executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/migrations/executor.py", line 96, in migrate
 self._migrate_all_backwards(plan, full_plan, fake=fake)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/migrations/executor.py", line 163, in
 _migrate_all_backwards
 self.unapply_migration(states[migration], migration, fake=fake)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/migrations/executor.py", line 218, in
 unapply_migration
 state = migration.unapply(state, schema_editor)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/migrations/migration.py", line 172, in unapply
 operation.database_backwards(self.app_label, schema_editor,
 from_state, to_state)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/migrations/operations/fields.py", line 206, in
 database_backwards
 self.database_forwards(app_label, schema_editor, from_state, to_state)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/migrations/operations/fields.py", line 201, in
 database_forwards
 schema_editor.alter_field(from_model, from_field, to_field)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/backends/base/schema.py", line 482, in
 alter_field
 old_db_params, new_db_params, strict)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/backends/postgresql/schema.py", line 116, in
 _alter_field
 self.execute(like_index_statement)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/backends/base/schema.py", line 110, in execute
 cursor.execute(sql, params)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/backends/utils.py", line 79, in execute
 return super(CursorDebugWrapper, self).execute(sql, params)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/backends/utils.py", line 64, in execute
 return self.cursor.execute(sql, params)
   File
 "/var/lib/jenkins/shiningpanda/jobs/914dc536/virtualenvs/d41d8cd9/lib/python3.4
 /site-packages/django/db/utils.py", line 95, in __exit__
 six.reraise(dj_exc_type, dj_exc_value, traceback)
   File