﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6148	Add generic support for database schemas	Erin Kelly		"There is frequently a need for Django to access data from tables in other schemas; this is especially true when building Django apps on top of legacy databases.  Currently, the proposed solution is to add support for the {{{set search_path}}} command (#1051) via custom initialization sql (#6064).  This is a good solution for PostgreSQL users, but it will not solve the problem in Oracle, which has no analogue of {{{set search_path}}}.

Solving the problem in a generic way will require adding a per-app or per-model db_schema option, in order to issue SQL queries using the syntax {{{""schema_name"".""table_name""}}}.  This may also require more advanced introspection (at least in Oracle) to determine whether the table already exists when running management commands.

A current workaround in Oracle is to manually create private synonyms inside the Django schema, referencing the necessary tables from other schemas.  However, the management commands do not currently recognize the existence of synonyms via introspection.  Additionally, the synonym solution may not be sufficiently generic in the long term."	New feature	new	Database layer (models, ORM)	dev	Normal		oracle postgresql mysql schemas	erik.engbrecht@… gabor@… jaensch@… Matt Boersma bruth@… hcarvalhoalves@… Joey Wilhelm Oldřich Jedlička iacobs+django@… grf@… faheem@… lameiro@… shaun_stanworth@… hr.bjarni+django@… hector@… sven@… bas@… dvanliere@… Andrii Kurinnyi martin.paquette@… gonzalemario@… ckarrie@… Brillgen Developers mgventura bituderr dcassidy36@… qbikk@… dcwatson@… ash@… npeihl mike@… tgecho mmitar@… anssi.kaariainen@… andrep pmountifield@… mprittie davidhalter88@… net147 esauro@… thisgenericname@… s3v gioviboy@… tomek@… w2lkm2n@… dpwrussell@… manelclos@… ghislain.leveque@… autodidacticon bnafta@… JorisBenschop david.fischer.ch@… axel.rau@… trbs@… zerks0@… Adam Brenecki Carlos Palol František Svoboda Ryan Hiebert curtis@… Adrien Delessert Petr Přikryl Ülgen Sarıkavak	Accepted	1	0	0	1	0	0
