Module: DataMapper::Constraints::Migrations::Relationship::ManyToOne

Defined in:
lib/data_mapper/constraints/migrations/relationship.rb

Instance Method Summary collapse

Instance Method Details

#auto_migrate_constraints_down(repository_name) ⇒ Object

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.



24
25
26
27
28
# File 'lib/data_mapper/constraints/migrations/relationship.rb', line 24

def auto_migrate_constraints_down(repository_name)
  adapter = DataMapper.repository(repository_name).adapter
  adapter.destroy_relationship_constraint(self)
  self
end

#auto_migrate_constraints_up(repository_name) ⇒ Object

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.



17
18
19
20
21
# File 'lib/data_mapper/constraints/migrations/relationship.rb', line 17

def auto_migrate_constraints_up(repository_name)
  adapter = DataMapper.repository(repository_name).adapter
  adapter.create_relationship_constraint(self)
  self
end