Class: CouchbaseOrm::IndexMigration::Operations::RemoveIndex
- Inherits:
-
Object
- Object
- CouchbaseOrm::IndexMigration::Operations::RemoveIndex
- Defined in:
- lib/couchbase-orm/index_migration/operations.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #execute(migration) ⇒ Object
-
#initialize(name) ⇒ RemoveIndex
constructor
A new instance of RemoveIndex.
- #inverse ⇒ Object
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
#name ⇒ Object (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 |
#inverse ⇒ Object
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 |