Permalink
Browse files

Adding support for RAW Oracle datatype.

  • Loading branch information...
1 parent 9b582af commit a3f03f7b61717ed36e59075752341129a563e1d5 basking2 committed Apr 2, 2011
@@ -285,7 +285,8 @@ def supports_savepoints? #:nodoc:
:time => { :name => "DATE" },
:date => { :name => "DATE" },
:binary => { :name => "BLOB" },
- :boolean => { :name => "NUMBER", :limit => 1 }
+ :boolean => { :name => "NUMBER", :limit => 1 },
+ :raw => { :name => "RAW", :limit => 1 }
}
# if emulate_booleans_from_strings then store booleans in VARCHAR2
NATIVE_DATABASE_TYPES_BOOLEAN_STRINGS = NATIVE_DATABASE_TYPES.dup.merge(
@@ -63,6 +63,8 @@ def simplified_type(field_type)
else
:decimal
end
+ when /raw/i
+ :raw
when /char/i
if OracleEnhancedAdapter.emulate_booleans_from_strings &&
OracleEnhancedAdapter.is_boolean_column?(name, field_type, table_name)
@@ -119,4 +121,4 @@ def string_to_date_or_time_using_format(string) #:nodoc:
end
-end
+end
@@ -31,6 +31,10 @@ def to_sql
alias to_s :to_sql
end
+ def raw(name, options={})
+ column(name, :raw, options)
+ end
+
def self.included(base) #:nodoc:
base.class_eval do
alias_method_chain :references, :foreign_keys

0 comments on commit a3f03f7

Please sign in to comment.