Re: ERMigration and skipModelNames

2014-07-04 Thread Paul Hoadley
Hi Matt,

On 4 Jul 2014, at 8:19 am, Matt Ness m...@logicsquad.net wrote:

 If I have an application-level Model, say AppLevelModel, which has an EO or 
 two with relationships to a framework model, say ERAttachment, and have the 
 following Properties in the application:
 
 er.migration.migrateAtStartup=true
 er.migration.createTablesIfNecessary=true
 er.migration.modelNames=AppLevelModel
 er.migration.skipModelNames=ERAttachment
 
 
 what should I expect to occur at runtime? As it stands, the migration process 
 attempts to run the ERAttachment0 java class, which is not really what I 
 want, and fails as those tables are already in the db. I perhaps naively 
 expected all values in that property to be skipped.
 
 This comes about (for me at least) when introducing the migration pattern 
 into an existing application with a db schema already up and running. I 
 obviously want to keep my db values in place and not have to 'start from 
 scratch'.
 
 Anyone used/using er.migration.skipModelNames? I have an (ugly) workaround, 
 but I'd like to know if my understanding of the pattern is wrong.

I’ve never used the skipModelNames property, but just eyeballing the code in 
ERXMigrator, it seems like it should be sufficient above to just set 
modelNames.  modelNames explicitly sets the list of models to migrate (in 
order).  If it’s not set, then you get all the models in the model group, in 
which case you might set skipModelNames to exclude one or more of them.  That 
is, it looks like there’s no need to exclude a model with skipModelNames if you 
don’t include it with modelNames, or settle for the default list.

Having said all of that, I would have expected what you’ve shown above to work 
as you intended.  (It should try and remove ERAttachment from the list 
containing just AppLevelModel, and then migrate just AppLevelModel.)  Are you 
sure those properties aren’t being over-ridden somewhere else?  Does the 
console dump of property values at launch time show those values above?


-- 
Paul Hoadley
http://logicsquad.net/



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

ERMigration and skipModelNames

2014-07-03 Thread Matt Ness
Hi all,

I seem to be missing something with the wonder Property

er.migration.skipModelNames

If I have an application-level Model, say AppLevelModel, which has an EO or 
two with relationships to a framework model, say ERAttachment, and have the 
following Properties in the application:

er.migration.migrateAtStartup=true
er.migration.createTablesIfNecessary=true
er.migration.modelNames=AppLevelModel
er.migration.skipModelNames=ERAttachment


what should I expect to occur at runtime? As it stands, the migration process 
attempts to run the ERAttachment0 java class, which is not really what I want, 
and fails as those tables are already in the db. I perhaps naively expected all 
values in that property to be skipped.

This comes about (for me at least) when introducing the migration pattern into 
an existing application with a db schema already up and running. I obviously 
want to keep my db values in place and not have to 'start from scratch'.

Anyone used/using er.migration.skipModelNames? I have an (ugly) workaround, but 
I'd like to know if my understanding of the pattern is wrong.

Regards,

Matt
--
http://logicsquad.net

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com