Re: DB Migration Paradigm?
Re: DB Migration Paradigm?
- Subject: Re: DB Migration Paradigm?
- From: "Yung-Luen Lan" <email@hidden>
- Date: Mon, 23 Jun 2008 06:49:55 +0800
Thanks David.
On Sat, Jun 21, 2008 at 3:48 AM, David Holt <email@hidden> wrote:
> Hello,
> You may want to move this question to the Wonder list for better answers.
> My response is below:
> On 20-Jun-08, at 12:33 AM, Yung-Luen Lan wrote:
> [SNIP]
> You'll need to read the package summary file
> <http://webobjects.mdimension.com/wonder/api/er/extensions/migration/package-summary.html> for
> information about how to incorporate migrations into an existing project.
> You will probably need to choose one method or the other. You could, for
> example, take the current state of the database as your Migration 0 and use
> the Wonder method going forward. Remember to either update your version
> table or set the property described in the overview file so that you don't
> recreate your existing tables. Be really careful with this stuff!! Back up
> your databases before you do any testing with it!!
Ah, it's my fault. I didn't realized that there's scroller on that page before!
> > And I'm adding prototype to my EOModel, which changes my EOModel a
> > lot. (each attribute will be assigned a prototype, which my change
> > their type or width.) Should I write my migration class for every
> > column manually?
> Not sure what you mean by this.
My existing model didn't use ERPrototypes. Now I want to assign each
column a prototype, but that will result a lot of changes to my model.
For example, some of my attribute (varchar) have external length 32,
and there's no varchar32 in the Prototypes popup menu in Entity
Modeler, so I'll choose the nearest varchar50. That will change a lot
of columns in my existing database! Just wonder if there is any way
that I don't need to write migration for each column manually.
> > Is there any way to generate those migration
> > automatically?
> You can generate the base migration class using EntityModeler. It takes
> prototypes into consideration, so this might address your question above.
> David
Yes, but it always generate migration file which create tables and
columns. In my case, I use this feature to generate Migration0, which
"generate" tables and columns of my existing db schema. (Well, it
didn't generate anything. I create this migration is just because I
want to let the ERMigration system know my existing project/model/db
and I'll use your trick to avoid them be really executed.) Now I want
to change the model a lot, how can I "incrementally" generate those
modifications? Like CoreData migration, you have the old model and new
one, and it will compare them automatically and give you the default
migration file.
Regards,
yllan
_______________________________________________
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