Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[Edapt] A question about custom migration
https://www.eclipse.org/forums/index.php/mv/msg/845091/1460547/#msg_1460547
Hi,
As far as I have understood the method :
public void migrateBefore(Model model, Metamodel metamodel) throws MigrationException {
// Put your code here before migration
}
It should receive the metamodel before modification has been applied. Right ?
What could be the reason why I currently receive the expected metamodel and not the initial ? Is it a problem of URI in historic ? Should the 'Custom Migration' be at the beginning of the release ?
I have also a model which refer to the new meta model too... While no migration has been done... Strange behavior....
]]>Olivier Prouvost2014-11-03T17:32:19-00:00Re: [Edapt] A question about custom migration
https://www.eclipse.org/forums/index.php/mv/msg/845091/1460552/#msg_1460552
May be a message should be displayed to inform the developper that it could fail... ? Is it really a good feature ? ]]>Olivier Prouvost2014-11-03T17:36:51-00:00Re: [Edapt] A question about custom migration
https://www.eclipse.org/forums/index.php/mv/msg/845091/1461129/#msg_1461129
It seems to be a problem with the CustomMigration. Javadoc says that CustomeMigration::migrateBefore is called before metamodel is changed, and migrateAfter after metamodel is changed.
BUT If we put a CustomMigration at the beginning of a release, the metamodel is not changed in the both Methods ! For the method migrateBefore this is ok, but not for migrateAfter !
If we put it a the end of the release, the metamodel received in both method is the metamodel changed !
Is there a specific usage I missed ? I work with the latest release (1.0.0.201410271332).
]]>Olivier Prouvost2014-11-04T08:28:11-00:00Re: [Edapt] A question about custom migration
https://www.eclipse.org/forums/index.php/mv/msg/845091/1463426/#msg_1463426
before and after in this case refers to before and after the change
operation the custom migration is attached to, NOT the full migration of
the release. This seems to be ambiguous in the JavaDoc, could you please
open a Bugzilla if you think so. Thanks!
Cheers,
Maximilian
Am 04.11.2014 09:28, schrieb Olivier Prouvost:
>
> It seems to be a problem with the CustomMigration. Javadoc says that
> CustomeMigration::migrateBefore is called before metamodel is changed,
> and migrateAfter after metamodel is changed.
> BUT If we put a CustomMigration at the beginning of a release, the
> metamodel is not changed in the both Methods ! For the method
> migrateBefore this is ok, but not for migrateAfter !
> If we put it a the end of the release, the metamodel received in both
> method is the metamodel changed !
> Is there a specific usage I missed ? I work with the latest release
> (1.0.0.201410271332).
>
>
--
Maximilian Kögel
Get Professional Eclipse Support: http://eclipsesource.com/munich]]>Maximilian Koegel2014-11-06T14:51:22-00:00Re: [Edapt] A question about custom migration
https://www.eclipse.org/forums/index.php/mv/msg/845091/1463750/#msg_1463750
So in my attached sample (customeMigration.png), my Custom Migration will always receive the same metamodel in the before and after method, because it stands at the end of my release ?
It would mean that if we want to store the data in the model before migration, we must have a custom migration at the beginning of the release to remember of the values, and another customMigration at the end of the release to transfer the information ?
Right ?
]]>Olivier Prouvost2014-11-06T22:19:32-00:00Re: [Edapt] A question about custom migration
https://www.eclipse.org/forums/index.php/mv/msg/845091/1467828/#msg_1467828
no, you need to attach a custom migration to the operations that destroy
information and read in the data before and write out the data after the
migration in the implementation of these custom migrations. In your case
probably the two deletes.
Best regards,
Maximilian
Am 06.11.2014 23:19, schrieb Olivier Prouvost:
> Ok.
>
> So in my attached sample (customeMigration.png), my Custom Migration will always receive the same metamodel in the before and after method, because it stands at the end of my release ?
>
> It would mean that if we want to store the data in the model before migration, we must have a custom migration at the beginning of the release to remember of the values, and another customMigration at the end of the release to transfer the information ?
>
> Right ?
>