-->
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.  [ 5 posts ] 
Author Message
 Post subject: Modifying a live production schema
PostPosted: Thu Oct 09, 2008 11:38 am 
Newbie

Joined: Thu Oct 09, 2008 11:05 am
Posts: 2
Hi,

I was wondering how other people go about updating their production (live) database schemas.
We've looked into the SchemaUpdate tool, but the documentation suggests it only works with .hbm files, or at least
doesn't explain how to use it in conjunction with annotations.

Basically, we're looking for a way to update a schema (using DDL statements: ALTER TABLE, etc.) in a database vendor-agnostic way.
Moreover, it's not always clear what has changed in the schema, since
we're modifying objects/mappings/etc. rather than actual tables and columns.

We're using Hibernate 3.2.6.ga.

Thanks,

--jon


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 12:10 pm 
Newbie

Joined: Sat Aug 02, 2008 12:09 pm
Posts: 12
At the moment I'm looking into LiquiBase

http://sourceforge.net/projects/liquibase/

Seems like it can do the job..


Cheers

G


Top
 Profile  
 
 Post subject: SchemaUpdate
PostPosted: Mon Oct 20, 2008 1:17 pm 
Newbie

Joined: Thu Oct 09, 2008 11:05 am
Posts: 2
Goran,

Thanks for your reply.

WRT SchemaUpdate, I've found confirmation via multiple sources (including the Hibernate docs), that SchemaUpdate was never intended for use in a production environment:

Quote:
"Furthermore, SchemaUpdate is only useful in development, per definition (a production schema is never updated automatically)."


I've been asked to put Liquibase through a proper analysis, but I wonder, have you had any positive (or otherwise) experience to report?

Thanks,

--jon


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 2:33 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
We are using the SchemaUpdate utility supplied by Hibernate in our project. I think it works well, but there are some things it can't do.

1. For new tables I can see no difference from a completely new installation
2. New columns in existing tables will not get any NOT NULL constraints or any default values
3. It can't change the datatype of existing columns
4. It doesn't add indexes to new or existing columns unless the table they live in is also new

There are probably more things it can't do, but the list above are the typical things we have come across. If we need special handling for 2-4 we have included the possibility to execute a manually written SQL script as well.


Top
 Profile  
 
 Post subject: This IDEA plugin might be helpful, liquibase ejb integration
PostPosted: Thu Nov 20, 2008 6:07 pm 
Newbie

Joined: Thu Nov 20, 2008 5:43 pm
Posts: 1
At my company, we have used hibernate for over a year and recently started using Liquibase with great success. We quickly discovered, however, that we wanted something that integrates Hibernate with Liquibase in our development environment Intellij IDEA. We decided to write a plugin that maintains the Liquibase file based on changes to the annotated Hibernate model.

You can find more information here:

http://plugins.intellij.net/plugin/?id=3698

From the description:

Liquibase EJB Integration Plug-in for IntelliJ IDEA. Compares Liquibase Database ChangeLog with EJB entity model providing inspections and intentions adding to ChangeLog.

Examples include:
* Add a new entity -> inspection to add liquibase addTable
* Add a new entity field -> inspection to add liquibase addColumn
* Change type of field -> inspection to add liquibase modifyColumn
* Rename field -> dialog to add liquibase renameColumn.

Other features:
* Liquibase EJB facet to configure and create changelog file.
* Context sensentive completion of table and column names within a changelog file.
* Tool window with schema as would be created by liquibase changelog as well as EJB model.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.