Skip to content

Commit d7a3e65

Browse files
Wijnandjosevalim
authored andcommitted
Postgresql doesn't allow to change a string type column to a binary type. Skip this test for postgresql for now. [rails#4616 state:resolved]
Signed-off-by: José Valim <[email protected]>
1 parent f58bdae commit d7a3e65

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

activerecord/test/cases/migration_test.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -860,13 +860,15 @@ def test_change_column_default
860860
assert_equal "Tester", Person.new.first_name
861861
end
862862

863-
def test_change_column_type_default_should_change
864-
old_columns = Person.connection.columns(Person.table_name, "#{name} Columns")
865-
assert !old_columns.find { |c| c.name == 'data' }
866-
867-
assert_nothing_raised do
868-
Person.connection.add_column "people", "data", :string, :default => ''
869-
Person.connection.change_column "people", "data", :binary
863+
unless current_adapter?(:PostgreSQLAdapter)
864+
def test_change_column_type_default_should_change
865+
old_columns = Person.connection.columns(Person.table_name, "#{name} Columns")
866+
assert !old_columns.find { |c| c.name == 'data' }
867+
868+
assert_nothing_raised do
869+
Person.connection.add_column "people", "data", :string, :default => ''
870+
Person.connection.change_column "people", "data", :binary
871+
end
870872
end
871873
end
872874

0 commit comments

Comments
 (0)