Thank you for the comments. I have taken a look at South and am moving towards integrating it in my app.
The incorrect sql being generated was resolved by restarting the computer, so now I do not have anything to show to you!! Regards, CM On Jul 6, 6:39 pm, JL <[email protected]> wrote: > Given that you mention that you already have a lot of data in your db, > I really recommend you check out South (http://south.aeracode.org/). > South is an application that adds migrations to your Django > application. When I develop new applications and the dataset is > small, I'll usually just use a combination of fixtures and sqlreset to > load up data. As applications get more mature and that gets to be a > problem, I'll add in South which in my mind is far and away the most > feature complete of the migration applications out there. > > Just to be clear though, here's the behavior of syncdb, sqlreset, > etc.: > > syncdb - Scan models, create tables for any new models found in > various models.py. Does not modify tables that already exist. > > reset - drop all existing applicaiton tables and recreate them as per > syncdb. > > sql - generate but don't execute all the sql that would run as part of > a syncdb command > > sqlreset - generate but don't execute all the sql that would run as > part of the reset command > > If you're still concerned about the incorrect sql being generated > (something I've never personally run into), could you please post your > models and the code that it's generating to something like dpaste? > > Thanks. > > On Jul 6, 6:25 am, Phil <[email protected]> wrote: > > > Hi, > > > you may want to try sqlreset keyword to get the right sql output for > > your db and put it down into the db directly (copy\paste) > > > something like this: > > python manage.py sqlreset yourapp > > > this will drop old tables and create all new ones. Though all data is > > going to be lost. > > syncdb doesn't change a thing if you run in after model changes, but > > it does for the new models. > > > Cheers, > > Phil > > > On Jul 6, 3:17 pm,chefsmart<[email protected]> wrote: > > > > Hi, > > > > I have been working on an app for some time now. I have been using the > > > Django svn trunk. > > > > I have a lot of data in the database. Today I modified a couple of > > > fields and added a couple of fields (date and char fields) to three of > > > my models. No fields have been removed from the original model > > > definitions. > > > > When I do "python manage.py sql myapp" the output shows some > > > inconsistent sql that is syntactically wrong. I thought this may > > > simply be a jumbled string output problem, so I ran syncdb anyway. > > > However, syncdb is not doing anything. I mean no messages, no error > > > outputs, nothing. It just simply exits with a blank line output. I > > > checked my database (mysql) and there were no changes made. So syncdb > > > is not doing anything, even though the sqlall output shows it wants to > > > do a lot of sql commands. > > > > Moreover, the manage.py sql myapp command shows that syncdb wants to > > > drop and reconstruct tables that I have not modified, and that are not > > > related to the modified models in any way. > > > > What could be going on? > > > > Regards, > > > CM --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

