#23459: not faking 0001_initial migration
----------------------------+--------------------
     Reporter:  brian       |      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
----------------------------+--------------------
 I tend to think something is wrong with my application, but can't think of
 what.

 (kg-manage is another name for manage.py)


 {{{
 (sid-amd64)root@aquitard:/# kg-manage  migrate
 Operations to perform:
   Synchronize unmigrated apps: pipeline, djcelery, captcha,
 django_tables2, ajax_select, jsonfield
   Apply all migrations: karaage, methods, sessions, sites, contenttypes,
 kgsoftware, kgusage, kgapplications
 Synchronizing apps without migrations:
   Creating tables...
   Installing custom SQL...
   Installing indexes...
 Running migrations:
   Applying kgusage.0001_initial...Traceback (most recent call last):
   File "/usr/share/python-karaage/bin/kg-manage", line 7, in <module>
     management.execute_from_command_line()
   File "/usr/lib/python2.7/dist-
 packages/django/core/management/__init__.py", line 385, in
 execute_from_command_line
     utility.execute()
   File "/usr/lib/python2.7/dist-
 packages/django/core/management/__init__.py", line 377, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/usr/lib/python2.7/dist-packages/django/core/management/base.py",
 line 288, in run_from_argv
     self.execute(*args, **options.__dict__)
   File "/usr/lib/python2.7/dist-packages/django/core/management/base.py",
 line 338, in execute
     output = self.handle(*args, **options)
   File "/usr/lib/python2.7/dist-
 packages/django/core/management/commands/migrate.py", line 160, in handle
     executor.migrate(targets, plan, fake=options.get("fake", False))
   File "/usr/lib/python2.7/dist-
 packages/django/db/migrations/executor.py", line 63, in migrate
     self.apply_migration(migration, fake=fake)
   File "/usr/lib/python2.7/dist-
 packages/django/db/migrations/executor.py", line 97, in apply_migration
     migration.apply(project_state, schema_editor)
   File "/usr/lib/python2.7/dist-
 packages/django/db/migrations/migration.py", line 107, in apply
     operation.database_forwards(self.app_label, schema_editor,
 project_state, new_state)
   File "/usr/lib/python2.7/dist-
 packages/django/db/migrations/operations/models.py", line 36, in
 database_forwards
     schema_editor.create_model(model)
   File "/usr/lib/python2.7/dist-packages/django/db/backends/schema.py",
 line 270, in create_model
     self.execute(sql, params)
   File "/usr/lib/python2.7/dist-packages/django/db/backends/schema.py",
 line 98, in execute
     cursor.execute(sql, params)
   File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py",
 line 65, in execute
     return self.cursor.execute(sql, params)
   File "/usr/lib/python2.7/dist-packages/mysql/connector/django/base.py",
 line 133, in execute
     return self._execute_wrapper(self.cursor.execute, query, args)
   File "/usr/lib/python2.7/dist-packages/mysql/connector/django/base.py",
 line 116, in _execute_wrapper
     utils.ProgrammingError(err.msg), sys.exc_info()[2])
   File "/usr/lib/python2.7/dist-packages/mysql/connector/django/base.py",
 line 113, in _execute_wrapper
     return method(query, args)
   File "/usr/lib/python2.7/dist-packages/mysql/connector/cursor.py", line
 494, in execute
     self._handle_result(self._connection.cmd_query(stmt))
   File "/usr/lib/python2.7/dist-packages/mysql/connector/connection.py",
 line 683, in cmd_query
     statement))
   File "/usr/lib/python2.7/dist-packages/mysql/connector/connection.py",
 line 601, in _handle_result
     raise errors.get_exception(packet)
 django.db.utils.ProgrammingError: Table 'cpu_job' already exists
 }}}

 I compared the schema of the cpu_job table on the database (mysql command
 "SHOW CREATE TABLE cpu_job") with the output from "kg-manage sqlmigrate
 kgusage 0001", they look identical apart from some differences in
 ordering.

 Other apps did the right thing without any problems.

--
Ticket URL: <https://code.djangoproject.com/ticket/23459>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.cd200415b94a1d15a9dcb0c5be4b4792%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to