MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / RemoveObsoleteDesignDocs

Method RemoveObsoleteDesignDocs

db/database.go:767–774  ·  view source on GitHub ↗

Removes previous versions of Sync Gateway's design docs found on the server

(ctx context.Context, previewOnly bool)

Source from the content-addressed store, hash-verified

765
766// Removes previous versions of Sync Gateway's design docs found on the server
767func (dbCtx *DatabaseContext) RemoveObsoleteDesignDocs(ctx context.Context, previewOnly bool) (removedDesignDocs []string, err error) {
768 ds := dbCtx.Bucket.DefaultDataStore()
769 viewStore, ok := ds.(sgbucket.ViewStore)
770 if !ok {
771 return []string{}, fmt.Errorf("Datastore does not support views")
772 }
773 return removeObsoleteDesignDocs(ctx, viewStore, previewOnly, dbCtx.UseViews())
774}
775
776// getDataStores returns all datastores on the database, including metadatastore
777func (dbCtx *DatabaseContext) getDataStores() []sgbucket.DataStore {

Callers 3

PostUpgradeMethod · 0.80
TestPostInstallCleanupFunction · 0.80

Calls 4

UseViewsMethod · 0.95
removeObsoleteDesignDocsFunction · 0.85
ErrorfMethod · 0.80
DefaultDataStoreMethod · 0.45

Tested by 2

TestPostInstallCleanupFunction · 0.64