• 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
Re: FK on composite keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FK on composite keys


  • Subject: Re: FK on composite keys
  • From: Kieran Kelleher <email@hidden>
  • Date: Tue, 28 Dec 2010 17:57:42 -0500

I often use Migrations to execute a SQL script file, which really allows you to do whatever you want to migrate the data. Also, you can combine regular migration java statements and then call a single line of java to execute the SQL file..... Here is an example......

	 @Override
	public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase database) throws Throwable {

		// Regular migration style logic
		ERXMigrationTable lCRoleTable = database.newTableNamed("role");
		lCRoleTable.newStringColumn("descriptor", 255, false);
		lCRoleTable.newIntegerColumn("oid", false);
		lCRoleTable.create();
	 	lCRoleTable.setPrimaryKey("oid");

		// Execute a bunch of custom SQL from a SQL file that can be found in Resources dir
		EOAdaptorChannel channel = database.adaptorChannel();

		ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(channel, "LCBusinessLogicMigration8.sql", "LCBusinessLogic");

	}


HTH,

Kieran





On Dec 28, 2010, at 4:23 PM, Michael Gargano wrote:

> Am I to understand correctly that migrations do not support FK constraints on composite keys?  What do I do in this situation use the JDBC connection?
>
> Thanks.
> -Mike
>
> _______________________________________________
> 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

 _______________________________________________
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

References: 
 >FK on composite keys (From: Michael Gargano <email@hidden>)

  • Prev by Date: Re: [OT] Finding currently edited file in WO Explorer
  • Next by Date: Re: [OT] Finding currently edited file in WO Explorer
  • Previous by thread: FK on composite keys
  • Next by thread: Old D2W Project Builder projects to new world?
  • Index(es):
    • Date
    • Thread