Re: Migration bug?
Re: Migration bug?
- Subject: Re: Migration bug?
- From: David LeBer <email@hidden>
- Date: Sat, 2 Jan 2010 12:29:27 -0500
Before we go any further, are you using WO5.4 and MySQL without using Ramsey's MySQL plugin?
<http://issues.objectstyle.org/jira/browse/WONDER-339>
On 2010-01-02, at 12:23 PM, Mark Woollard wrote:
> Am using Wonder Project migration for the first time. The initial database creation works but am now trying to add a single column as the second revision of the database. When running application am getting error as follows:
>
> Jan 02 17:13:28 TheApp[53817] INFO er.extensions.jdbc.ERXJDBCUtilities - Executing alter table t_position null c_abbreviation longtext NOT NULL
> Jan 02 17:14:11 TheApp[53817] DEBUG NSLog - === Commit Internal Transaction
> Jan 02 17:14:11 TheApp[53817] DEBUG NSLog - === Begin Internal Transaction
> Jan 02 17:14:11 TheApp[53817] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "UPDATE _dbupdater SET lockowner = NULL, updatelock = ? WHERE modelname = ?" withBindings: 1:0(updateLock), 2:"MockDraft"(modelName)>
> Jan 02 17:14:11 TheApp[53817] DEBUG NSLog - === Commit Internal Transaction
> Jan 02 17:14:11 TheApp[53817] DEBUG NSLog - === Begin Internal Transaction
> Jan 02 17:14:20 TheApp[53817] DEBUG NSLog - === Rollback Internal Transaction
> Jan 02 17:14:36 TheApp[53817] ERROR er.extensions.appserver.ERXApplication - TheApp failed to start.
> MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null c_abbreviation longtext NOT NULL' at line 1
>
> The database is mysql, and it seems to me that the alter statement is incorrect on the first line of the log, there should be 'add column' rather than 'null'. The migration class is as follows:
>
> public class DbVersion1 extends Migration {
>
> @Override
> public void downgrade(EOEditingContext ec, ERXMigrationDatabase database)
> throws Throwable {
> database.existingTableNamed("t_position").existingColumnNamed("c_abbreviation").delete();
> }
>
> @Override
> public void upgrade(EOEditingContext ec, ERXMigrationDatabase database)
> throws Throwable {
> ERXMigrationTable table = database.existingTableNamed("t_position");
> table.newStringColumn("c_abbreviation", false, "");
> }
> }
>
> The new column is using the varchar10 prototype. Am stuck as can't see why the sql is being generated incorrectly. Anyone have any ideas?
>
> Thanks
> Mark
>
>
>
> _______________________________________________
> 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
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
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