• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ERMigration and skipModelNames
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERMigration and skipModelNames


  • Subject: Re: ERMigration and skipModelNames
  • From: Paul Hoadley <email@hidden>
  • Date: Fri, 04 Jul 2014 16:10:17 +1000

Hi Matt,

On 4 Jul 2014, at 8:19 am, Matt Ness <email@hidden> 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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >ERMigration and skipModelNames (From: Matt Ness <email@hidden>)

  • Prev by Date: Re: EO_PK_TABLE and weird stuff
  • Next by Date: D2W and localization
  • Previous by thread: ERMigration and skipModelNames
  • Next by thread: D2W and localization
  • Index(es):
    • Date
    • Thread