> > > Is there any downside to starting with the models first? > > The biggest one is that if you decide later to add a field to the model that > isn't there and you've filled in some data to the db.
I agree 100%. On this project (and some I've worked on before) I know I'll be adding fields as it becomes apparent I'll need them. And I know even with some great schema planning I'll still be adding fields well after the test data for those models is in place. > > I tend to start with the models first and when I add a field, I just use alter > to update the table in place. This has a gotcha with NOT NULL though, if you > don't specify a default you'll end up with an error. To bypass this error, I > usually don't add the NOT NULL constraint till after I've added the field and > updated the existing rows with the required data. > I might have to end up using this approach since it seems like a relatively easy solution. It seems to me that this sort of thing is the kind of thing that just requires a little repetition and grinding (especially with a lot of changes...) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---