Orca Ninja
Orca Ninja

Reputation: 833

Grails Updating Production Database

What happens in Grails, when you update your model, and deploy it to your web server? Does the existing data get overwritten?

Upvotes: 1

Views: 580

Answers (2)

marko
marko

Reputation: 3776

If your model is changed you need to upgrade your db, you can use this plugin.

Make sure you change you setting from create-drop to update.

There are a couple of good guides you can look at, here is a good one.

Good luck!

Upvotes: 4

Nicolas Modrzyk
Nicolas Modrzyk

Reputation: 14197

The behavior is defined in the GORM configuration

Basically, the default for development is drop-create, which erase all the content, and recreate tables.

On more stable releases, update might be a good setting knowing that Hibernate prefer to fails that conflict.

As always, I would recommend making a backup of the DB before performing such operation on pre-production and production systems.

Upvotes: 3

Related Questions