Ticket #233 (closed enhancement: fixed)
South supporting multiple databases
| Reported by: | cmkmrr | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.7 |
| Component: | databaseapi | Version: | 0.6 |
| Keywords: | multidb multi-db multiple database | Cc: | craig.kimerer@… |
Description
On Django's 1.2 Roadmap (http://code.djangoproject.com/wiki/Version1.2Features) there is a proposed feature of the multi-db work that Alex Gaynor did for the GSoC.
Making south work with multiple databases (with the branch mentioned above), will probably be worthwhile.
I have a partial patch right now (not complete) that I am attaching for feedback.
Attachments
Change History
Changed 4 years ago by cmkmrr
- Attachment south-multidb.diff added
comment:1 follow-up: ↓ 3 Changed 3 years ago by anonymous
MultiDB has now been committed, and South currently fails on it:
(venv)computer:build user$ ./manage.py syncdb
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "*/venv/src/django/django/core/management/init.py", line 439, in execute_manager
utility.execute()
File "*/venv/src/django/django/core/management/init.py", line 380, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "*/venv/src/django/django/core/management/init.py", line 257, in fetch_command
klass = load_command_class(app_name, subcommand)
File "*/venv/src/django/django/core/management/init.py", line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "*/venv/src/django/django/utils/importlib.py", line 35, in import_module
import(name)
File "*/venv/lib/python2.6/site-packages/south/management/commands/syncdb.py", line 5, in <module>
from south import migration
File "*/venv/lib/python2.6/site-packages/south/migration.py", line 17, in <module>
from south.db import db
File "*/venv/lib/python2.6/site-packages/south/db/init.py", line 17, in <module>
db = module.DatabaseOperations?()
AttributeError?: 'module' object has no attribute 'DatabaseOperations?'
comment:2 Changed 3 years ago by andrew
- Status changed from new to assigned
- Milestone set to 0.7
MultiDB isn't the only 1.2 feature which South doesn't work with; after the feature freeze, I'll be fixing that.
comment:3 in reply to: ↑ 1 Changed 3 years ago by Linas
Replying to anonymous:
MultiDB has now been committed, and South currently fails on it:
(venv)computer:build user$ ./manage.py syncdb
Traceback (most recent call last):
File "*/venv/lib/python2.6/site-packages/south/db/init.py", line 17, in <module>
db = module.DatabaseOperations?()
AttributeError?: 'module' object has no attribute 'DatabaseOperations?'
This can be fixed by explicitly providing a custom
SOUTH_DATABASE_ADAPTER = 'south.db....'
in settings.py.
The worse problem is that since rev 11889 contenttypes/management:update_contenttypes expects 'db' as a keyword argument and throws http://south.aeracode.org/ticket/310 without it.
Anyway, Andrew, thank you for the great work!
Linas
comment:4 Changed 3 years ago by andrew
- Status changed from assigned to closed
- Resolution set to fixed
South now works fine with the new multidb support. [a29e90b115df] adds a --database option to migrate to choose your database.

This patch should apply cleanly to rev 377.