From: Pascal R. <pr...@ma...> - 2010-01-06 07:12:38
|
Your migration class should look like this : public class WOCommunity1 extends ERAttachmentMigration { public WOCommunity1() { super("ORGANIZATION_PROFILE", "ORGP_LOGOID", true); } public NSArray<ERXModelVersion> modelDependencies() { return null; } @Override public void downgrade(EOEditingContext editingContext, ERXMigrationDatabase database) throws Throwable { // DO NOTHING } } ORGANIZATION_PROFILE being the table that have a relation to ERAttachment, ORGP_LOGOIP being the column that store the attachment PK. I ran this migration after the first one (WOCommunity0), who created all the tables from my model. Have you check the recording from WOWODC East? David is discussing migrations in details in this one : http://www.wocommunity.org/podcasts/WOWODC09E-ThisYearModel.mov > I can't seem to find the magic properties combination... > > I have an existing database and model. I want to add ERAttachment > using this > very cool "Migrations" feature. However, it keeps breaking when it > tries to create > the table that exists. > > If I set > > MusicFestModel.InitialMigrationVersion=1 > > Then nothing runs? I can't seem to just make it create ERAttachments. > > Thoughts? > Thanks > James Cicenia > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc |