[Glass] Grrrr cannot migrate (class rename with subclasses and with a name of a deleted class)

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Wed Aug 26 15:40:39 PDT 2015


Mariano,

I'm not a class migration expert ... I'm aware of some of the special 
problems/limitations of the auto migration code, but I really haven't 
studied the ins/outs of custom migration plans...

With that said, I will take a crack at helping ...

First a question: are 1), 2), 3) three separate steps along the way to a 
single end or are they three separate attempts to "solve the problem"?

When you say it didn't work, are you getting errors; or are you ending 
up with missing classes or incorrect structure?

Hopefully someone who has done something similar to this will step in 
before I start reading documentation and code:)

Dale


On 8/26/15 3:16 PM, Mariano Martinez Peck via Glass wrote:
> Hi guys,
>
> Sorry to bother again but I really can't migrate. I tried everything, 
> nothing worked. I admit I have a weird scenario, but still.
>
> - I have a class FaSecurityClosingPriceRecord which has no instance 
> nor subclasses.
> - I have a separate class called FaSecurityClosingPriceRecord2 (yes, 
> don't ask please) which a special superclass and also have 2 
> subclasses (this is a different hierarchy than  than 
> FaSecurityClosingPriceRecord). Both subclasses do have instances.
>
> So...what I need to do is remove old class 
> FaSecurityClosingPriceRecord and rename FaSecurityClosingPriceRecord2 
> to FaSecurityClosingPriceRecord. And of course, migrating the sub 
> instances.  I tried the following (in order)
>
> 1) First monticello commit only the removal of 
> FaSecurityClosingPriceRecord. Then upload code, commit and #doBulkMigrate.
>
> 2) Monticello commit where I rename FaSecurityClosingPriceRecord2 to 
> FaSecurityClosingPriceRecord (so subclasses now are subclass of 
> FaSecurityClosingPriceRecord). And I made a copy of 
> FaSecurityClosingPriceRecord and call it 
> FaSecurityClosingPriceRecord2. So to sum up, I have both classes 
> (being equal) FaSecurityClosingPriceRecord and 
> FaSecurityClosingPriceRecord2 and just that 
> FaSecurityClosingPriceRecord is the one that has the subclasses.
>
> 3) Then I tried something like:
>
> FaSecurityClosingPriceRecord2 addNewVersion: 
> FaSecurityClosingPriceRecord.System commit.
> FaSecurityClosingPriceRecord2 migrateInstancesTo: 
> FaSecurityClosingPriceRecord.
> FaSecurityClosingPriceRecord2 removeFromSystem.
> But that didn't work at all.
> So...how should be the steps I can do to make this refactor/migration? 
> I found no example of classes with subclasses and renaming one in the 
> middle of hierarchy in the guide, so I wonder if this is a special 
> case or not.
> Thanks in advance!
>
>
> -- 
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150826/8b212de7/attachment.html>


More information about the Glass mailing list