Ticket #371 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

New --database option for migrate command doesn't work

Reported by: agodfrey@… Owned by: andrew
Priority: major Milestone: 0.7
Component: commands Version: 0.6-pre
Keywords: command, database, multiple Cc:


I attempted using the --database option when migrating and noticed it always used the default database.

'default': {

'NAME': 'test',
'ENGINE': 'django.db.backends.mysql',
'USER': 'test',

'test': {

'NAME': 'test1',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'test1',



Using the command:
python migrate appname --database=test

The default database is used instead of 'test'. It appears the correct database is set at

However, uses the import: from south.db import db. When it does that the last line of that file always sets the db to the default. So even though we passed in a different database at the command line it is always overwritten during the import.


Change History

comment:1 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [2273d7101099]. It was actually because "from x import y" imports copy the namespace, so when we reassign in south.db.db it doesn't reassign in the module.


Add a comment

Modify Ticket

as closed

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

Note: See TracTickets for help on using tickets.