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

Ticket #10855: drop_table_force_test.diff

File drop_table_force_test.diff, 0.6 kB (added by adamwiggins, 6 months ago)

unit test "drop table if exists"

  • a/activerecord/test/migration_test.rb

    old new  
    188188      assert !Person.connection.tables.include?(:test_drop_table) 
    189189    end 
    190190 
     191    if current_adapter?(:PostgreSQLAdapter) 
     192      def test_drop_table_force 
     193        assert_nothing_raised do 
     194          Person.connection.drop_table :does_not_exist, :force => true 
     195        end 
     196      end 
     197    end 
     198 
    191199    # SQL Server, Sybase, and SQLite3 will not allow you to add a NOT NULL 
    192200    # column to a table without a default value. 
    193201    unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :SQLiteAdapter)