Skip to content

Commit

Permalink
Merge pull request #174 from emmanuelgautier/fix-mongostorage-jsdoc
Browse files Browse the repository at this point in the history
fix multiple jsdoc lines related to MongoDBStorage
  • Loading branch information
PascalPflaum authored Nov 18, 2018
2 parents 3f7c126 + a924a5b commit 372c4aa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = class Umzug extends EventEmitter {
*
* @param {Object} [options]
* @param {String} [options.storage='json'] - The storage. Possible values:
* 'json', 'sequelize', an argument for `require()`, including absolute paths.
* 'json', 'sequelize', 'mongodb', an argument for `require()`, including absolute paths.
* @param {function|false} [options.logging=false] - The logging function.
* A function that gets executed every time migrations start and have ended.
* @param {String} [options.upName='up'] - The name of the positive method
Expand Down Expand Up @@ -398,7 +398,7 @@ module.exports = class Umzug extends EventEmitter {
/**
* Try to require and initialize storage.
*
* @returns {*|SequelizeStorage|JSONStorage|Storage}
* @returns {*|SequelizeStorage|JSONStorage|MongoDBStorage|Storage}
* @private
*/
_initStorage () {
Expand Down
46 changes: 23 additions & 23 deletions src/storages/MongoDBStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import _ from 'lodash';
import Storage from './Storage';

/**
* @class JSONStorage
* @class MongoDBStorage
*/
export default class MongoDBStorage extends Storage {
/**
* Constructs MongoDB collection storage.
*
* @param {Object} [options]
* Required either connection and collectionName OR collection
* @param {String} [options.connection] - a connection to target database established with MongoDB Driver
* @param {String} [options.collectionName] - name of migration collection in MongoDB
* @param {String} [options.collection] - reference to a MongoDB Driver collection
*/
* Constructs MongoDB collection storage.
*
* @param {Object} [options]
* Required either connection and collectionName OR collection
* @param {String} [options.connection] - a connection to target database established with MongoDB Driver
* @param {String} [options.collectionName] - name of migration collection in MongoDB
* @param {String} [options.collection] - reference to a MongoDB Driver collection
*/
constructor ({connection, collectionName, collection}) {
super();
this.connection = connection;
Expand All @@ -30,30 +30,30 @@ export default class MongoDBStorage extends Storage {
}

/**
* Logs migration to be considered as executed.
*
* @param {String} migrationName - Name of the migration to be logged.
* @returns {Promise}
*/
* Logs migration to be considered as executed.
*
* @param {String} migrationName - Name of the migration to be logged.
* @returns {Promise}
*/
logMigration (migrationName) {
return this.collection.insertOne({migrationName});
}

/**
* Unlogs migration to be considered as pending.
*
* @param {String} migrationName - Name of the migration to be unlogged.
* @returns {Promise}
*/
* Unlogs migration to be considered as pending.
*
* @param {String} migrationName - Name of the migration to be unlogged.
* @returns {Promise}
*/
unlogMigration (migrationName) {
return this.collection.removeOne({migrationName});
}

/**
* Gets list of executed migrations.
*
* @returns {Promise.<String[]>}
*/
* Gets list of executed migrations.
*
* @returns {Promise.<String[]>}
*/
executed () {
return this.collection.find({})
.sort({migrationName: 1})
Expand Down

0 comments on commit 372c4aa

Please sign in to comment.