Module: DataMapper::Migrations::OracleAdapter::ClassMethods
- Defined in:
- lib/dm-migrations/adapters/dm-oracle-adapter.rb
Instance Method Summary collapse
-
#auto_migrate_reset_sequences(value = :not_specified) ⇒ Symbol
Set if sequences will or will not be reset during auto_migrate!.
-
#auto_migrate_with(value = :not_specified) ⇒ Symbol
Use table truncate or delete for auto_migrate! to speed up test execution.
-
#type_map ⇒ Hash
private
Types for Oracle databases.
Instance Method Details
#auto_migrate_reset_sequences(value = :not_specified) ⇒ Symbol
Set if sequences will or will not be reset during auto_migrate!
316 317 318 319 320 |
# File 'lib/dm-migrations/adapters/dm-oracle-adapter.rb', line 316 def auto_migrate_reset_sequences(value = :not_specified) return @auto_migrate_reset_sequences.nil? ? true : @auto_migrate_reset_sequences if value == :not_specified raise ArgumentError unless [true, false].include?(value) @auto_migrate_reset_sequences = value end |
#auto_migrate_with(value = :not_specified) ⇒ Symbol
Use table truncate or delete for auto_migrate! to speed up test execution
301 302 303 304 305 306 |
# File 'lib/dm-migrations/adapters/dm-oracle-adapter.rb', line 301 def auto_migrate_with(value = :not_specified) return @auto_migrate_with if value == :not_specified value = nil if value == :drop_and_create raise ArgumentError unless [nil, :truncate, :delete].include?(value) @auto_migrate_with = value end |
#type_map ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Types for Oracle databases.
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/dm-migrations/adapters/dm-oracle-adapter.rb', line 274 def type_map length = Property::String::DEFAULT_LENGTH precision = Property::Numeric::DEFAULT_PRECISION scale = Property::Decimal::DEFAULT_SCALE @type_map ||= { Integer => { :primitive => 'NUMBER', :precision => precision, :scale => 0 }, String => { :primitive => 'VARCHAR2', :length => length }, Class => { :primitive => 'VARCHAR2', :length => length }, BigDecimal => { :primitive => 'NUMBER', :precision => precision, :scale => nil }, Float => { :primitive => 'BINARY_FLOAT', }, DateTime => { :primitive => 'DATE' }, Date => { :primitive => 'DATE' }, Time => { :primitive => 'DATE' }, TrueClass => { :primitive => 'NUMBER', :precision => 1, :scale => 0 }, Property::Text => { :primitive => 'CLOB' }, }.freeze end |