Class: CouchbaseOrm::IndexSchemaMigration

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

Constant Summary collapse

DOCUMENT_ID =
'couchbaseorm::index_schema_migrations'

Instance Method Summary collapse

Instance Method Details

#add_version(version) ⇒ Object



11
12
13
14
15
# File 'lib/couchbase-orm/index_schema_migration.rb', line 11

def add_version(version)
  updated_versions = (versions + [version.to_s]).uniq.sort
  persist_versions(updated_versions)
  updated_versions
end

#remove_version(version) ⇒ Object



17
18
19
20
21
# File 'lib/couchbase-orm/index_schema_migration.rb', line 17

def remove_version(version)
  updated_versions = versions - [version.to_s]
  persist_versions(updated_versions)
  updated_versions
end

#versionsObject



7
8
9
# File 'lib/couchbase-orm/index_schema_migration.rb', line 7

def versions
  Array(current_document['versions']).map(&:to_s).sort
end