Re: ERXMigrationTable.newColumn does not set default value
Re: ERXMigrationTable.newColumn does not set default value
- Subject: Re: ERXMigrationTable.newColumn does not set default value
- From: Mike Schrag <email@hidden>
- Date: Thu, 10 Apr 2008 00:09:07 -0400
Using DB defaults may *not* be a good idea if you don't also have
them in EOF code. EOF will save and then have a different value in
mem as in the DB.
The intent (though I don't know if it's clear in the API) of setting
defaults is ONLY for use in migrations so that you can add a not-null
column and set a default value for existing rows to prevent it from
failing with a constraint violation. They should ONLY be used on not-
null columns that are also marked allows null = false in your model so
EOF will fail before it hits the DB, or you will suffer the fate that
Anjo describes.
ms
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden