Hello, well I created the Migration Class, and then run the application, getting this error:
and it did this.
Oct 16 18:32:57 ControlHorarios[1250] (ERXJDBCUtilities.java:588) INFO er.extensions.jdbc.ERXJDBCUtilities - Executing CREATE TABLE _dbupdater(lockowner varchar(100), modelname varchar(100) NOT NULL, updatelock long NOT NULL, version long NOT NULL)
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "UPDATE _dbupdater SET lockowner = ?, updatelock = ? WHERE (modelname = ? AND (updatelock = ? OR lockowner = ?))" withBindings: 1:"ControlHorarios--1"(lockOwner), 2:1(updateLock), 3:"ScheduleControl"(modelName), 4:0(updateLock), 5:"ControlHorarios--1"(lockOwner)>
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Commit Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "SELECT t0.updatelock FROM _dbupdater t0 WHERE t0.modelname = ?" withBindings: 1:"ScheduleControl"(modelName)>
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - 0 row(s) processed
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Commit Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "INSERT INTO _dbupdater(lockowner, version, updatelock, modelname) VALUES (?, ?, ?, ?)" withBindings: 1:"ControlHorarios--1"(lockOwner), 2:-1(version), 3:1(updateLock), 4:"ScheduleControl"(modelName)>
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Commit Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXJDBCMigrationLock.java:114) INFO er.extensions.migration.ERXJDBCMigrationLock - Waiting on updateLock for model 'ScheduleControl' ...
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "SELECT t0.version FROM _dbupdater t0 WHERE t0.modelname = ?" withBindings: 1:"ScheduleControl"(modelName)>
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - fetch canceled
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - 1 row(s) processed
Oct 16 18:32:57 ControlHorarios[1250] (ERXMigrator.java:401) INFO er.extensions.migration.ERXMigrator - Upgrading ScheduleControl to version 0 with migration 'controlHorarios.app.migration.ScheduleControl0@737e47'
Oct 16 18:32:57 ControlHorarios[1250] (ERXJDBCUtilities.java:588) INFO er.extensions.jdbc.ERXJDBCUtilities - Executing CREATE TABLE EMPLOYEE(EMAIL varchar(50) NOT NULL, NAME varchar(50) NOT NULL, PASSWORD varchar(10) NOT NULL, id int NOT NULL)
Oct 16 18:32:57 ControlHorarios[1250] (ERXJDBCUtilities.java:588) INFO er.extensions.jdbc.ERXJDBCUtilities - Executing ALTER TABLE EMPLOYEE ADD PRIMARY KEY (id)
Oct 16 18:32:57 ControlHorarios[1250] (ERXJDBCUtilities.java:588) INFO er.extensions.jdbc.ERXJDBCUtilities - Executing CREATE TABLE EMPLOYEETURN(CREATION_DATE datetime NOT NULL, EMPLOYEE_ID int NOT NULL, TURN_ID int NOT NULL, id int NOT NULL)
Oct 16 18:32:57 ControlHorarios[1250] (ERXJDBCUtilities.java:588) INFO er.extensions.jdbc.ERXJDBCUtilities - Executing ALTER TABLE EMPLOYEETURN ADD PRIMARY KEY (id)
Oct 16 18:32:57 ControlHorarios[1250] (ERXJDBCUtilities.java:588) INFO er.extensions.jdbc.ERXJDBCUtilities - Executing ALTER TABLE EMPLOYEETURN ADD CONSTRAINT EMPLOYEETURN_EMPLOYEE_ID_id_FK FOREIGN KEY (EMPLOYEE_ID) REFERENCES EMPLOYEE (id)
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Commit Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "UPDATE _dbupdater SET lockowner = NULL, updatelock = ? WHERE modelname = ?" withBindings: 1:0(updateLock), 2:"ScheduleControl"(modelName)>
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Commit Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Rollback Internal Transaction
Oct 16 18:32:57 ControlHorarios[1250] (ERXNSLogLog4jBridge.java:43) WARN NSLog - A fatal exception occurred: Migration failed.
[2008-10-16 18:32:57 COT] <main> er.extensions.migration.ERXMigrationFailedException: Migration failed.
at er.extensions.migration.ERXMigrator$ERXMigrationAction.doPerform(ERXMigrator.java:420)
at er.extensions.eof.ERXEOAccessUtilities$ChannelAction.perform(ERXEOAccessUtilities.java:1409)
at er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:175)
at er.extensions.appserver.ERXApplication.finishInitialization(ERXApplication.java:898)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
at com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588)
at com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
at com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546)
at com.webobjects.appserver.WOApplication.run(WOApplication.java:1229)
at er.extensions.appserver.ERXApplication.run(ERXApplication.java:992)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:548)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:535)
at controlHorarios.app.Application.main(Application.java:12)
Caused by: java.sql.SQLException: SQL ERROR - [position 24, near 'ADD' in 'PLOYEETURN ADD CONSTRAINT'] alter table command expected but not found.
SQL: [B@e9ebe1
at com.openbase.net.c.a(Unknown Source)
at com.openbase.jdbc.c.a(Unknown Source)
at com.openbase.jdbc.c.execute(Unknown Source)
at com.openbase.jdbc.c.executeUpdate(Unknown Source)
at er.extensions.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:590)
at er.extensions.migration.ERXMigrationTable.addForeignKey(ERXMigrationTable.java:1051)
at er.extensions.migration.ERXMigrationTable.addForeignKey(ERXMigrationTable.java:1036)
at er.extensions.migration.ERXMigrationTable.addForeignKey(ERXMigrationTable.java:1014)
at controlHorarios.app.migration.ScheduleControl0.upgrade(ScheduleControl0.java:38)
at er.extensions.migration.ERXMigrationDatabase$Migration.upgrade(ERXMigrationDatabase.java:417)
at er.extensions.migration.ERXMigrator$ERXMigrationAction.doPerform(ERXMigrator.java:403)
... 16 more