• Feeds

    Get updates delivered to your reader or your email in-box: Subscribe to RSS or .

  • About Me

    I am a Java, Groovy and Grails consultant and software architect. I have worked with Java for many years, but recently I have taken an interest in new languages for the Java Platform - such as Groovy!   read more

  • Find Me

Grails Tip: Using Schema Export

Ever wonder what the DDL would look like that Grails generates to create or update your database? Well, no need to wonder any longer. Grails is packed full with little things to make your life simpler, and one that you may not have heard of yet is the Grails ’schema-export’ command line option. Under the covers this handy utility delegates to Hibernate’s SchemaExport. The output can either go to a file or to standard out.

Examples:

  • ‘grails schema-export’ : generates the DDL for the development environment into the default file ddl.sql
  • ‘grails prod schema-export’ : generates the DDL for the production environment to the default file ddl.sql
  • ‘grails schema-export export’ : generates the export DDL (drop then create)
  • ‘grails schema-export stdout’ : generates the DDL and sends it to starndard out
Related Posts with Thumbnails
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Printed from: http://www.brentbaxter.com/2010/03/09/grails-tip-using-schema-export/ .
© Brent Baxter 2010.

Leave a Comment