#16039: syncdb with --database option fails -------------------------------------+------------------------------------- Reporter: yedpodtrzitko | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 1.4 (models, ORM) | Resolution: Severity: Release blocker | Triage Stage: Design Keywords: | decision needed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by akaariai): It seems the only common multi-db setups for contenttypes are "in single database" and "one DB contains master data, others mirror it". We could work a solution based on the following: - Document that it is suggested that one syncs the contenttypes/permissions table only into one DB (do we need an easier way than routers here? Could we somehow have this default to "default" database in global_settings.py?) - If there is need for master-slave like setup for contenttypes, if we know which DB is the master, which slaves (again, do we need something else than routers?) then we can have syncdb handle the syncing of data. Read from master, copy to slave, ensure PK values match. - If users create contenttypes and/or permissions manually by the ORM in master-slave setup, then there will be no automatic replication. This is a documentation issue. Most users having a master-slave setup will need to deal with this possibility anyways. The hardest question is how to make it easy to define which DB is the master, and which (if any) are the slaves. We could take an approach where the "default" database is the master for contenttypes/permissions unless there are routers, in which case we inspect the router's for_write and allow_sync for the master/slaves. -- Ticket URL: <https://code.djangoproject.com/ticket/16039#comment:19> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.