diff --git a/lib/tasks/hair_trigger.rake b/lib/tasks/hair_trigger.rake index 892acc0..287990f 100644 --- a/lib/tasks/hair_trigger.rake +++ b/lib/tasks/hair_trigger.rake @@ -11,6 +11,8 @@ namespace :db do namespace :schema do desc "Create a db/schema.rb file that can be portably used against any DB supported by AR" task :dump => :environment do + next unless ActiveRecord::Base.schema_format == :ruby + require 'active_record/schema_dumper' filename = ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb" ActiveRecord::SchemaDumper.previous_schema = File.exist?(filename) ? File.read(filename) : nil