aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-02-11 09:17:10 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-02-11 09:17:10 +0000
commit5b7630e17423f6c906fb4438766463b25c6fc133 (patch)
treecb8e293b79dce431af5ffb1e5c42745b77ca754f /activerecord/test
parent002c0aeef3302d6cceecfd039a325e0eef59c17a (diff)
downloadrails-5b7630e17423f6c906fb4438766463b25c6fc133.tar.gz
rails-5b7630e17423f6c906fb4438766463b25c6fc133.tar.bz2
rails-5b7630e17423f6c906fb4438766463b25c6fc133.zip
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
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/migration_test.rb9
1 files changed, 6 insertions, 3 deletions
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