Permalink
Browse files

MySQL disallows TEXT defaults so don't test for them.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 002c0ae commit 5b7630e17423f6c906fb4438766463b25c6fc133 @jeremy jeremy committed Feb 11, 2007
Showing with 6 additions and 3 deletions.
  1. +6 −3 activerecord/test/migration_test.rb
@@ -108,26 +108,29 @@ def test_create_table_with_not_null_column
end
def test_create_table_with_defaults
+ # MySQL doesn't allow defaults on TEXT or BLOB columns.
+ mysql = current_adapter?(:MysqlAdapter)
+
Person.connection.create_table :testings do |t|
t.column :one, :string, :default => "hello"
t.column :two, :boolean, :default => true
t.column :three, :boolean, :default => false
t.column :four, :integer, :default => 1
- t.column :five, :text, :default => "hello"
+ t.column :five, :text, :default => "hello" unless mysql
end
columns = Person.connection.columns(:testings)
one = columns.detect { |c| c.name == "one" }
two = columns.detect { |c| c.name == "two" }
three = columns.detect { |c| c.name == "three" }
four = columns.detect { |c| c.name == "four" }
- five = columns.detect { |c| c.name == "five" }
+ five = columns.detect { |c| c.name == "five" } unless mysql
assert_equal "hello", one.default
assert_equal true, two.default
assert_equal false, three.default
assert_equal 1, four.default
- assert_equal "hello", five.default
+ assert_equal "hello", five.default unless mysql
ensure
Person.connection.drop_table :testings rescue nil

0 comments on commit 5b7630e

Please sign in to comment.