#23065: Migration Error when removing unique constraint
----------------------------+------------------------
     Reporter:  anonymous   |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Migrations  |    Version:  1.7-rc-1
     Severity:  Normal      |   Keywords:  migrations
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0           |      UI/UX:  0
----------------------------+------------------------
 I try to make a migration which simple removes "unique = True" from a
 field. and get the error below.

 Note this is nothing to do with Django's standard auth module, but a
 custom implementation, as far as I can see that should have nothing to do
 with it.

 This is a private project so I can't give many more details than this. I'm
 using Postgres and the current 1.7 rc.

 {{{
 python manage.py makemigrations
 Migrations for 'Auth':
   0003_auto_20140721_1413.py:
     - Alter field name on permission
 (env)samuel || python manage.py migrate
 Operations to perform:
   Synchronize unmigrated apps: bootstrapform, django_jinja, admin_tools,
 theming, dashboard
   Apply all migrations: Schedule, admin, sessions, auth, contenttypes,
 Accounts, Auth, CRM
 Synchronizing apps without migrations:
   Creating tables...
   Installing custom SQL...
   Installing indexes...
 Running migrations:
   Applying Auth.0003_auto_20140721_1413...Traceback (most recent call
 last):
   File "manage.py", line 10, in <module>
     execute_from_command_line(sys.argv)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/core/management/__init__.py", line 385, in
 execute_from_command_line
     utility.execute()
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/core/management/__init__.py", line 377, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/core/management/base.py", line 288, in run_from_argv
     self.execute(*args, **options.__dict__)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/core/management/base.py", line 337, in execute
     output = self.handle(*args, **options)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/core/management/commands/migrate.py", line 160, in handle
     executor.migrate(targets, plan, fake=options.get("fake", False))
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/migrations/executor.py", line 62, in migrate
     self.apply_migration(migration, fake=fake)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/migrations/executor.py", line 96, in apply_migration
     migration.apply(project_state, schema_editor)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/migrations/migration.py", line 107, in apply
     operation.database_forwards(self.app_label, schema_editor,
 project_state, new_state)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/migrations/operations/fields.py", line 131, in
 database_forwards
     schema_editor.alter_field(from_model, from_field, to_field)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/backends/schema.py", line 506, in alter_field
     self._alter_field(model, old_field, new_field, old_type, new_type,
 old_db_params, new_db_params, strict)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/backends/schema.py", line 525, in _alter_field
     "name": constraint_name,
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/backends/schema.py", line 98, in execute
     cursor.execute(sql, params)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/backends/utils.py", line 81, in execute
     return super(CursorDebugWrapper, self).execute(sql, params)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/backends/utils.py", line 65, in execute
     return self.cursor.execute(sql, params)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/utils.py", line 94, in __exit__
     six.reraise(dj_exc_type, dj_exc_value, traceback)
   File "/path/to/project/env/local/lib/python2.7/site-
 packages/django/db/backends/utils.py", line 65, in execute
     return self.cursor.execute(sql, params)
 django.db.utils.ProgrammingError: constraint "auth_permission_name_key" of
 relation "Auth_permission" does not exist

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23065>
Django <https://code.djangoproject.com/>
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/052.23625c7abc99eeed0d0f72be6b372953%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to