Actually, those ramblings might not be relevant just yet...
I made a simple patch to syncdb to see if an application has a migrations module or not. If it does, it will run it. If not, it will do its automated thing. Seems to work quite well at the moment and let me get rid of about a third of the migration code. Mike On 4/20/2007, "Mike H" <[EMAIL PROTECTED]> wrote: > > >Ah, thanks for the heads up! > >Unfortunately, syncdb will install the latest SQL for all installed >applications (as far as I am aware). Is there a way just to install the >schema for a specific application? I guess I could call sqlall and run >each supplied statement, but that's pretty much just reimplementing >install ;-) > >The reason I need to do this is because keeping track of the revision a >model is at and working out which migrations need to be run gets quite >complex. For this initial version of the migrator I am doing all SQL >through the migrations. Of course, the django management can be used to >generate those initial migrations... > >I have some documentation up at > >http://www.asmwc.com/dbmigration/ > >(this is changing literally minute by minute as I produce it!) > >Perhaps what I need to do is keep a revision number in each model's Meta >class. Then when I roll out a model to a server the migrator can check >to see if it has been installed before. If not, it can use django to >generate the sql and install it. If it has been installed before it can >see what revision was installed previously and run the migrations that >are flagged with the intermediate revision numbers... > >Mike > >On 4/20/2007, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > >> >>On 4/20/07, Mike H <[EMAIL PROTECTED]> wrote: >>> >>> Before I release the code, I want to make the migrator call 'install' >>> from django.core.management if it doesn't find a migration module for >>> an app. Also, as this is being done as part of a work project, I have to >>> get permission to release the code from my employer, but this should not >>> be a problem. >> >>FYI, the 'install' command was removed in 0.96 in favour of 'syncdb'. >>Syncdb will identify any missing tables and install them, but it >>currently doesn't install m2m tables that have been added to an >>existing model. >> >>> Hopefully I'll have something released by the end of today, if not, by >>> the end of Monday. >> >>Can't wait to see it! >> >>Yours, >>Russ Magee %-) >> >> > >> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

