Modify

Ticket #702 (assigned defect)

Opened 4 years ago

Last modified 3 years ago

South + tests + multidb: missing south_migrationhistory table in the second db

Reported by: reinout@… Owned by: andrew
Priority: major Milestone: 1.0
Component: commands Version: unknown
Keywords: Cc:

Description

I sometimes work with a second database that's pretty much fixed. Existing database that the customer provides and that we only need to read. So I have router that only allows a single app's tables in there. When creating/migrating databases, everything is well as onthe the main database is created/migrated by default.

When running the tests, however, both databases are. So south complains that the second DB doesn't have a south_migrationhistory table.

  $> bin/test
  ...
  Creating test database...
  Syncing...
  Creating table aaa
  Creating table bbb
  ...
  No fixtures found.
  Migrating...
  Running migrations for ccc:
   - Migrating forwards to 0001_initial.
  ...
  No fixtures found.

  Synced:
   > aaa
   > bbb

  Migrated:
   - ccc

  Creating test database 'the_second_database'...
  Syncing...
  Creating table ddd
  Creating table eee
  No fixtures found.
  Migrating...
  Traceback (most recent call last):
  ...
  django.db.utils.DatabaseError: no such table: south_migrationhistory

What to do about this? A workaround is to add

SOUTH_TESTS_MIGRATE = False

to my settings.py, btw.

Attachments

Change History

comment:1 Changed 4 years ago by andrew

  • Status changed from new to infoneeded
  • Milestone set to 1.0

That's odd, South should be made in the other database. Do you have a custom database router installed?

View

Add a comment

Modify Ticket

Action
as assigned
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.