-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Schema update problem
PostPosted: Fri Oct 24, 2003 5:51 am 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 25, 2003 9:18 am 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
Still can't make it work... It seems that the capabilities of the schema updater is rather underdocumented.

Could someone please explain what changes can be made safely? My problem is simply changing the name of a field, so I'm afraid more advanced updates will fail too.

Anyone???


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.