Wisdom

The erudition of Inventive Labs, collected.

Archive / RSS
May 12

Protecting the auto-migrating schema

If you’re using Err’s Auto Migrations, you’ll want to eradicate a default Rails task that clobbers your carefully-crafted schema file. Add this to your Rakefile:

Rake.application.instance_variable_get(:@tasks).delete(
  'db:schema:dump'
)
namespace(:db) {
  namespace(:schema) {
    task(:dump) { puts 'Schema dump disabled' }
  }
}


Page 1 of 1