Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11458: arrgh.diff

File arrgh.diff, 1.7 kB (added by jbarnette, 2 months ago)

seriously, my codes are perfect (patch -p0)

  • activerecord/lib/active_record/migration.rb

    old new  
    343343      end 
    344344       
    345345      def run(direction, migrations_path, target_version) 
    346         self.new(direction, migrations_path, target_version) 
     346        self.new(direction, migrations_path, target_version).run 
    347347      end 
    348348 
    349349      def schema_info_table_name 
  • railties/lib/tasks/databases.rake

    old new  
    104104      version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil 
    105105      raise "VERSION is required" unless version 
    106106      ActiveRecord::Migrator.run(:up, "db/migrate/", version) 
     107      Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby 
    107108    end 
    108109 
    109110    desc 'Runs the "down" for a given migration VERSION.' 
     
    111112      version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil 
    112113      raise "VERSION is required" unless version 
    113114      ActiveRecord::Migrator.run(:down, "db/migrate/", version) 
     115      Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby 
    114116    end     
    115117  end 
    116118 
     
    118120  task :rollback => :environment do 
    119121    step = ENV['STEP'] ? ENV['STEP'].to_i : 1 
    120122    ActiveRecord::Migrator.rollback('db/migrate/', step) 
     123    Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby 
    121124  end 
    122125 
    123126  desc 'Drops and recreates the database from db/schema.rb for the current environment.'