2

I just dropped production database. It happened because I used dbCreate = "create" instead of "update" in DataSource.groovy.

I was changing some domain models and wanted to update the database. dbCreate value was empty string (""), and I accidentally changed it to "create" instead of "update".

How could I prevent this from happening in the future (grails wise or in general)?

  • 4
    don't log into the DB with a user with the ability to drop tables – ratchet freak Apr 9 '14 at 8:26
7

Don't give DROP DATABASE or DROP TABLE privileges to the DB user you use for Grails.

It might also be a good idea to withhold most other privileges (other then INSERT, SELECT, DELETE) in production, as you don't want Grails to automagically do an ALTER TABLE operation that locks an important table for 30 minutes...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.