aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/migration_test.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2006-05-21 15:13:28 +0000
committerMarcel Molina <marcel@vernix.org>2006-05-21 15:13:28 +0000
commitd22f9c948859827f170b9a93820bf06aa720743c (patch)
treef0764860abf25c4d855c9bcf6fe208e8bc23ec34 /activerecord/test/migration_test.rb
parent422cba934c218c7725c115615d942344aa067aba (diff)
downloadrails-d22f9c948859827f170b9a93820bf06aa720743c.tar.gz
rails-d22f9c948859827f170b9a93820bf06aa720743c.tar.bz2
rails-d22f9c948859827f170b9a93820bf06aa720743c.zip
Fix Oracle boolean support and tests. Closes #5139. [schoenm@earthlink.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4351 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/migration_test.rb')
-rw-r--r--activerecord/test/migration_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb
index e71790ed1f..0f837841e1 100644
--- a/activerecord/test/migration_test.rb
+++ b/activerecord/test/migration_test.rb
@@ -106,14 +106,8 @@ if ActiveRecord::Base.connection.supports_migrations?
four = columns.detect { |c| c.name == "four" }
assert_equal "hello", one.default
- if current_adapter?(:OracleAdapter)
- # Oracle doesn't support native booleans
- assert_equal true, two.default == 1
- assert_equal false, three.default != 0
- else
- assert_equal true, two.default
- assert_equal false, three.default
- end
+ assert_equal true, two.default
+ assert_equal false, three.default
assert_equal 1, four.default
ensure
@@ -147,6 +141,11 @@ if ActiveRecord::Base.connection.supports_migrations?
assert_equal 'smallint', one.sql_type
assert_equal 'integer', four.sql_type
assert_equal 'bigint', eight.sql_type
+ elsif current_adapter?(:OracleAdapter)
+ assert_equal 'NUMBER(38)', default.sql_type
+ assert_equal 'NUMBER(1)', one.sql_type
+ assert_equal 'NUMBER(4)', four.sql_type
+ assert_equal 'NUMBER(8)', eight.sql_type
end
ensure
Person.connection.drop_table :testings rescue nil
@@ -328,6 +327,7 @@ if ActiveRecord::Base.connection.supports_migrations?
new_columns = Topic.connection.columns(Topic.table_name, "#{name} Columns")
assert_nil new_columns.find { |c| c.name == 'approved' and c.type == :boolean and c.default == true }
assert new_columns.find { |c| c.name == 'approved' and c.type == :boolean and c.default == false }
+ assert_nothing_raised { Topic.connection.change_column :topics, :approved, :boolean, :default => true }
end
def test_change_column_with_new_default