I'm testing SchemaUpdate without success. Perhaps I'm doing something wrong, but the test case is rather simple:
I use the Play / Team example and <b>successfully</b> creates the database using SchemaExport. Then I change one column name from salary to salari (just to test). The following happends (on Sybase, using jConnect 5.5):
INFO: processing foreign key constraints
alter table Player add salari FLOAT
24.okt.2003 11:14:05 net.sf.hibernate.tool.hbm2ddl.SchemaUpdate execute
SEVERE: Unsuccessful: alter table Player add salari FLOAT
com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'Player' failed. Default clau
se is required in order to add non-NULL column 'salari'.
at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2535)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1916)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:201)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:182)
at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1540)
at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:15
23)
at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:41
1)
at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:
120)
at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.main(SchemaUpdate.java:74)
24.okt.2003 11:14:05 net.sf.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: schema update complete
|