From 5b7630e17423f6c906fb4438766463b25c6fc133 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 11 Feb 2007 09:17:10 +0000 Subject: 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 --- activerecord/test/migration_test.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb index 3cc8c18988..09cb6a6b51 100644 --- a/activerecord/test/migration_test.rb +++ b/activerecord/test/migration_test.rb @@ -108,12 +108,15 @@ if ActiveRecord::Base.connection.supports_migrations? 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) @@ -121,13 +124,13 @@ if ActiveRecord::Base.connection.supports_migrations? 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 -- cgit v1.2.3