Class MongoMigration
java.lang.Object
org.jobrunr.storage.nosql.mongo.migrations.MongoMigration
- Direct Known Subclasses:
M001_CreateJobCollection
,M002_CreateRecurringJobCollection
,M003_CreateBackgroundJobServerCollection
,M004_CreateJobStatsCollection
,M005_CreateMetadataCollectionAndDropJobStats
,M006_UpdateRecurringJobsCollectionAddCreatedAtIndex
,M007_UpdateJobsCollectionReplaceIndices
,M007_UpdateJobsCollectionReplaceIndices
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
collectionExists
(com.mongodb.client.MongoDatabase mongoDatabase, String collectionName) protected boolean
createCollection
(com.mongodb.client.MongoDatabase mongoDatabase, String name) protected void
createIndex
(com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection, org.bson.conversions.Bson index, com.mongodb.client.model.IndexOptions indexOptions) protected void
dropIndexes
(com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection) protected Boolean
abstract void
runMigration
(com.mongodb.client.MongoDatabase mongoDatabase, String collectionPrefix)
-
Constructor Details
-
MongoMigration
public MongoMigration()
-
-
Method Details
-
runMigration
public abstract void runMigration(com.mongodb.client.MongoDatabase mongoDatabase, String collectionPrefix) -
createCollection
-
collectionExists
protected boolean collectionExists(com.mongodb.client.MongoDatabase mongoDatabase, String collectionName) -
dropIndexes
protected void dropIndexes(com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection) -
createIndex
protected void createIndex(com.mongodb.client.MongoCollection<org.bson.Document> mongoCollection, org.bson.conversions.Bson index, com.mongodb.client.model.IndexOptions indexOptions) -
isBackgroundOperationInProgressException
-