Class: CouchbaseOrm::IndexMigration::Operations::RemoveIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase-orm/index_migration/operations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ RemoveIndex

Returns a new instance of RemoveIndex.



44
45
46
# File 'lib/couchbase-orm/index_migration/operations.rb', line 44

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



42
43
44
# File 'lib/couchbase-orm/index_migration/operations.rb', line 42

def name
  @name
end

Instance Method Details

#execute(migration) ⇒ Object



48
49
50
# File 'lib/couchbase-orm/index_migration/operations.rb', line 48

def execute(migration)
  migration.execute_query(migration.query_builder.remove_index(name))
end

#inverseObject



52
53
54
# File 'lib/couchbase-orm/index_migration/operations.rb', line 52

def inverse
  raise IrreversibleMigration.new('remove_index is not reversible. Define down explicitly.')
end