Ticket #11592: fix_11592_migrations_broken_on_clean_db.git.patch
| File fix_11592_migrations_broken_on_clean_db.git.patch, 2.1 kB (added by ian.w.white@gmail.com, 3 months ago) |
|---|
-
a/activerecord/lib/active_record/migration.rb
old new 364 364 end 365 365 366 366 def current_version 367 Base.connection.select_values( 368 "SELECT version FROM #{schema_migrations_table_name}").map(&:to_i).max || 0 367 version = Base.connection.select_values( 368 "SELECT version FROM #{schema_migrations_table_name}").map(&:to_i).max rescue nil 369 version || 0 369 370 end 370 371 371 372 def proper_table_name(name) -
a/activerecord/test/cases/migration_test.rb
old new 812 812 ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/interleaved/pass_3") 813 813 end 814 814 end 815 815 816 def test_migrator_db_has_no_schema_migrations_table 817 ActiveRecord::Base.connection.execute("DROP TABLE schema_migrations;") 818 assert_nothing_raised do 819 ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid", 1) 820 end 821 end 822 816 823 def test_migrator_verbosity 817 824 ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/valid", 1) 818 825 assert PeopleHaveLastNames.message_count > 0 … … 1010 1017 end 1011 1018 1012 1019 end 1013 1020 1014 1021 uses_mocha 'Sexy migration tests' do 1015 1022 class SexyMigrationsTest < ActiveRecord::TestCase 1016 1023 def test_references_column_type_adds_id