Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
04/09/08 16:20:15 (8 months ago)
Author:
rick
Message:

Add support for interleaving migrations by storing which migrations have run in the new schema_migrations table. Closes #11493 [jordi]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/schema_dumper.rb

    r8124 r9244  
    3131        @connection = connection 
    3232        @types = @connection.native_database_types 
    33         @info = @connection.select_one("SELECT * FROM schema_info") rescue nil 
     33        @version = Migrator::current_version rescue nil 
    3434      end 
    3535 
    3636      def header(stream) 
    37         define_params = @info ? ":version => #{@info['version']}" : "" 
     37        define_params = @version ? ":version => #{@version}" : "" 
    3838 
    3939        stream.puts <<HEADER 
     
    6060      def tables(stream) 
    6161        @connection.tables.sort.each do |tbl| 
    62           next if ["schema_info", ignore_tables].flatten.any? do |ignored| 
     62          next if ['schema_migrations', ignore_tables].flatten.any? do |ignored| 
    6363            case ignored 
    6464            when String; tbl == ignored