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 protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]