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)?

gnat
  • 21,442
  • 29
  • 112
  • 288
Uros K
  • 123
  • 4

1 Answers1

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...

Michael Borgwardt
  • 51,037
  • 13
  • 124
  • 176