• 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
ERAttachments and Migration open a Jira?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERAttachments and Migration open a Jira?


  • Subject: ERAttachments and Migration open a Jira?
  • From: Theodore Petrosky <email@hidden>
  • Date: Sat, 16 Oct 2010 16:16:09 -0700 (PDT)

So here is my test case.

1. I created a new wonder project.
2. include the ERAttachment and Postgresql framewords
3. set my connection dictionary and migrations to:

# Connection Dictionary
dbConnectURLGLOBAL=jdbc:postgresql://localhost/thetestdb?capitalizeTypenames=true&zeroDateTimeBehavior=convertToNull
dbConnectUserGLOBAL=asacksadmin
dbConnectPasswordGLOBAL=4004
dbConnectPluginGLOBAL=PostgresqlPlugIn
dbConnectDriverGLOBAL=org.postgresql.Driver


# Migrations
er.migration.migrateAtStartup=true
er.migration.createTablesIfNecessary=true
er.migration.modelNames=MyEOModel
MyEOModel.MigrationClassPrefix=your.app.migrations.Mig

4. Created a migration called Mig0 in the correct folder.
5. on running my webobjects app, it indeed created the erattachment tables.

6. stopped the app
7. dropdb
8. createdb

9. copied the migration from EOModeler:

	@Override
	public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase database) throws Throwable {
		ERXMigrationTable newEntityTable = database.newTableNamed("t_new_entity");
		newEntityTable.newLargeStringColumn("c_first_name", false);
		newEntityTable.newIntegerColumn("id", false);
		newEntityTable.newIntegerColumn("c_photo_id", false);
		newEntityTable.create();
	 	newEntityTable.setPrimaryKey("id");

		newEntityTable.addForeignKey("c_photo_id", "ERAttachment", "id");
	}

re-run the app. and it fails:

Caused by: org.postgresql.util.PSQLException: ERROR: relation "erattachment" does not exist

it seems that for Postgresql, it runs the EOModel migration before the erattachment migration which causes the failure because the erattachment tables have not been created yet.

Should I open a Jira?

I am never comfortable opening Jiras because I always feel the problems are my limited understanding.

Ted



--- On Sat, 10/16/10, David Holt <email@hidden> wrote:

> From: David Holt <email@hidden>
> Subject: Re: help with ERAttachments
> To: "Theodore Petrosky" <email@hidden>
> Cc: "Mike Schrag" <email@hidden>, email@hidden
> Date: Saturday, October 16, 2010, 3:56 PM
>
> On 2010-10-16, at 11:48 AM, Theodore Petrosky wrote:
>
> > Let me state the question again,
> >
> > If you ran your migration against Frontbase, would you
> expect your Tutorial0 to create both the Person table and
> the erattachment table?
>
> Ahhh, no. The migrations for ERAttachment are happening
> because you have included that framework in your build path
> when you start up your application. If you look in the
> _dbupdater table, you'll see the version for ERAttachment
> framework model in a row in that table. You can find the
> migrations files in the source code for the framework. By
> enabling migrations at start up, you are going to run the
> migrations in any frameworks that contain migration classes
> as well (for example ERCoreBusinessLogic).
>
> >




 _______________________________________________
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

  • Follow-Ups:
    • Re: ERAttachments and Migration open a Jira?
      • From: Pascal Robert <email@hidden>
References: 
 >Re: help with ERAttachments (From: David Holt <email@hidden>)

  • Prev by Date: Re: [ANN] Safari Extension 0.91
  • Next by Date: Re: ERAttachments and Migration open a Jira?
  • Previous by thread: Re: help with ERAttachments
  • Next by thread: Re: ERAttachments and Migration open a Jira?
  • Index(es):
    • Date
    • Thread