So, defaults have always been an issue. While PostgreSQL, for example,
lets you add a NOT NULL column with no defaults to an empty table, the
same is not true of some other DBMSen - I think SQLite is among them.
Modifying the frozen ORM is also the wrong way; what you're supposed to
do (and what is entirely non-obvious) is copy the field definition over
the orm['app.model:field'] call and add default=foo there.
This is obviously awful, so the current plan for 0.7 (some of which is
already done, some of which is coming) is:
- Startmigration once again uses proper field definitions (e.g.
models.CharField(max_length=500)) in the migrations files it creates
- More importantly, startmigration will detect when you're adding a NOT
NULL field and prompt you for what default you wish to give it (if none
is defined on the model) - I make this same mistake all the time, and
it's annoying me.
This should solve this issue in general, hopefully, and make it more
obvious where to proceed. I'll hopefully have a working beta of 0.7 in
the new year.
Andrew
> --
>
> You received this message because you are subscribed to the Google Groups "South Users" group.
> To post to this group, send email to
south...@googlegroups.com.
> To unsubscribe from this group, send email to
south-users...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/south-users?hl=en.
>
>