Christoph, If you make an EOEntityIndex on the column(s) then you should get unique index stuff generated in migrations. The uniqueness is enforced by the database, but you can watch for it in your SQL helper and produce a validation exception. The postgresql helper does this. Other databases (MySQL) may not provide enough info in the exception message to determine what unique index is causing the exception though. Look at handleDatabaseException in ERXSQLHelper.
Ramsey On Jul 19, 2013, at 9:16 AM, Henrique Prange wrote: > Hi Christoph, > > Even though I've never used it, I think you can use one variation of the > addUniqueIndex method in the ERXMigrationTable class to add the unique > constraint in the database using migrations. Then you can use the > ERXEOControlUtilities.validateUniquenessOf method to check the uniqueness > programmatically and avoid database exceptions. > > Unfortunately, I don't know any option to activate this behavior through > EOModeler. > > Cheers, > > Henrique > > On 19/07/2013, at 10:41, Christoph Wick <[email protected]> wrote: > >> Hello list, >> >> is there an easy, WO-style way to ensure the uniqueness of entity properties? >> >> SQL supports it (by making columns UNIQUE), but I didn't find anything in >> EOModeler as well as in ERXMigration. >> >> There is ERXEOControlUtilities.validateUniquenessOf(...) but I think this >> doesn't use the database level (so I think it MAY fail in a multi instance >> deployment). >> >> Thanks in advance. >> C.U.CW >> -- >> What are the three enemies of a programmer? Sunlight, oxygen, and the >> appalling roar of the birds. >> >> >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list ([email protected]) >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/webobjects-dev/hprange%40gmail.com >> >> This email sent to [email protected] > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com > > This email sent to [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
