aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/fixtures/db_definitions/oracle.sql4
-rw-r--r--activerecord/test/migration_test.rb16
2 files changed, 10 insertions, 10 deletions
diff --git a/activerecord/test/fixtures/db_definitions/oracle.sql b/activerecord/test/fixtures/db_definitions/oracle.sql
index 39099b1747..48d6bdf073 100644
--- a/activerecord/test/fixtures/db_definitions/oracle.sql
+++ b/activerecord/test/fixtures/db_definitions/oracle.sql
@@ -37,7 +37,7 @@ create table topics (
bonus_time timestamp default null,
last_read timestamp default null,
content varchar(4000),
- approved integer default 1,
+ approved number(1) default 1,
replies_count integer default 0,
parent_id integer references topics initially deferred disable,
type varchar(50) default null,
@@ -53,7 +53,7 @@ create table topics (
bonus_time date default null,
last_read date default null,
content varchar(4000),
- approved integer default 1,
+ approved number(1) default 1,
replies_count integer default 0,
parent_id integer references topics initially deferred disable,
type varchar(50) default null,
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