#24524: Automatic migrations prevent creation of initial database table layout
-------------------------------------+-------------------------------------
     Reporter:  SimonSteinberger     |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Migrations           |                  Version:  1.8rc1
     Severity:  Normal               |               Resolution:
                                     |  worksforme
     Keywords:  migrations, fail,    |             Triage Stage:
  collision                          |  Unreviewed
    Has patch:  0                    |      Needs documentation:  1
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by jbrendel):

 Thank you for getting back to me.

 I did as you asked and ran "./manage.py test -v2 <appname>" for one of my
 apps. Here is the output:
 {{{
 $ python manage.py test -v2 utils
 Creating test database for alias 'default' ('test_db_utils')...
 Operations to perform:
   Synchronize unmigrated apps: staticfiles, admindocs, utils, messages,
 social_auth, toplevel, django_extensions, check_js, crispy_forms
   Apply all migrations: sessions, admin, auth, sites, contenttypes,
 accounts, appcore
 Synchronizing apps without migrations:
   Creating tables...
     Creating table social_auth_usersocialauth
     Creating table social_auth_nonce
     Creating table social_auth_association
     Running deferred SQL...
 Traceback (most recent call last):
   File "manage.py", line 10, in <module>
     execute_from_command_line(sys.argv)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/__init__.py", line 354, in
 execute_from_command_line
     utility.execute()
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/__init__.py", line 346, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/commands/test.py", line 30, in
 run_from_argv
     super(Command, self).run_from_argv(argv)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/base.py", line 394, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/commands/test.py", line 74, in execute
     super(Command, self).execute(*args, **options)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/base.py", line 445, in execute
     output = self.handle(*args, **options)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/commands/test.py", line 90, in handle
     failures = test_runner.run_tests(test_labels)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django_coverage/coverage_runner.py", line 76, in run_tests
     extra_tests, **kwargs)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/test/runner.py", line 210, in run_tests
     old_config = self.setup_databases()
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/test/runner.py", line 166, in setup_databases
     **kwargs
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/test/runner.py", line 370, in setup_databases
     serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE",
 True),
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/db/backends/base/creation.py", line 383, in create_test_db
     test_flush=not keepdb,
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/__init__.py", line 120, in call_command
     return command.execute(*args, **defaults)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/base.py", line 445, in execute
     output = self.handle(*args, **options)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/commands/migrate.py", line 179, in handle
     created_models = self.sync_apps(connection,
 executor.loader.unmigrated_apps)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/core/management/commands/migrate.py", line 318, in
 sync_apps
     cursor.execute(statement)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/db/backends/utils.py", line 62, in execute
     return self.cursor.execute(sql)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/db/utils.py", line 98, in __exit__
     six.reraise(dj_exc_type, dj_exc_value, traceback)
   File "/home/jbrendel/projects/zzyyxx/local/lib/python2.7/site-
 packages/django/db/backends/utils.py", line 62, in execute
     return self.cursor.execute(sql)
 django.db.utils.ProgrammingError: relation "accounts_usermodel" does not
 exist
 }}}

 I hope this helps. Please let me know if there's any other info I can
 provide.

 Thank you very much!

--
Ticket URL: <https://code.djangoproject.com/ticket/24524#comment:18>
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/074.dc981fdee391e08c98f99f477d56100b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to