Module: CheckedTypes::Model

Defined in:
lib/dm-checked-types/migrations.rb

Instance Method Summary collapse

Instance Method Details

#auto_migrate_down_with_custom_types!(repository_name = self.repository_name) ⇒ Object



77
78
79
80
81
82
83
# File 'lib/dm-checked-types/migrations.rb', line 77

def auto_migrate_down_with_custom_types!(repository_name = self.repository_name)
  return unless storage_exists?(repository_name)
  return if self.respond_to?(:is_remixable?) && self.is_remixable?

  adapter = DataMapper.repository(repository_name).adapter
  adapter.destroy_custom_type_statements(repository_name, self)
end

#auto_migrate_up_with_custom_types!(repository_name = self.repository_name) ⇒ Object



85
86
87
88
89
90
# File 'lib/dm-checked-types/migrations.rb', line 85

def auto_migrate_up_with_custom_types!(repository_name = self.repository_name)
  return if self.respond_to?(:is_remixable?) && self.is_remixable?

  adapter = DataMapper.repository(repository_name).adapter
  adapter.create_custom_type_statements(repository_name, self)
end