Ticket #369 (closed enhancement: wontfix)
Specify database in migration class when using multiple databases
|Reported by:||agodfrey@…||Owned by:||andrew|
|Keywords:||multiple databases, django1.2||Cc:|
I've been testing out the --database=name option for the migrate command and it works well. I'm using python fabric for automated deployment. My problem is that during deployment to the production server an automated process is used. At the time of deployment I would need to manually look at each migration to determine which database it is using which would mean all schema and data migrations would need to be done manually. My thought was to be able to specify the database to be used in the migration class similar to the no_dry_run attribute.
It would look something like:
database = 'other_than_default'
This attribute could also be specified via the command line to populate it.
python manage.py schemamigration some_app schema_name --auto --database="some_other_db"
Then when running the migrate command each migration would be applied to the default database if nothing is specified or to the one specified per migration.