On 19/03/12 11:08, Jonathan French wrote:
On 18 March 2012 23:33, Russell Keith-Magee <russ...@keith-magee.com
<mailto:russ...@keith-magee.com>> wrote:
> 2. An inspection tool that generates the appropriate python code
after
> inspecting models and current state of database.
The current consensus is that this shouldn't be Django's domain --
at least, not in the first instance. It might be appropriate to
expose an API to extract the current model state in a Pythonic form,
but a fully-fledged, user accessible "tool".
Is there a writeup anywhere of why this is the consensus? AFAICT it
looks like Django already provides half of this in the form of
DatabaseIntrospection, that e.g. South actually uses, which generates a
model class from the current state of the database. Doing the diff as
well doesn't seem like much of a stretch, and might make it more likely
for third party custom fields to be made migrateable, if the interface
for doing so is in Django core.
No writeup that I know of - however, the main part of the work here
would be the "model differencing" code, which means creating a versioned
ORM, being able to load and save model definitions to some kind of
format, and the actual difference-creating code, which is all too much
to stick into Django.
I've long maintained that I want South to become just that automatic
differencing code, and to just move the actual database API across; this
is mostly because I see there being scope for other kinds of migration
systems apart from the kind South is (for example, a very declarative
one, whose model states are retrieved using the combination of all
migrations, rather than a lump on the bottom of the last one).
As for your proposal, Kushagra, Russ has said most of the points I would
have thought of and a few more - I'd recommend a good look into previous
discussions on this mailing list for most of the current views on how we
want the schema alteration API to work.
I would, however, definitely recommend not touching the Oracle or MSSQL
backends - three is already a lot of work, and they're harder databases
to get a hold of for testing.
Andrew
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.