src/storages/JSONStorage.js
/**
   * 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}
Logs migration to be considered as executed . @param { String } migrationName - Name of the migration to be logged . @returns { Promise }
logMigration (migrationName) {
    let filePath = this.path;
    let readfile = Bluebird.promisify(fs.readFile);
    let writefile = Bluebird.promisify(fs.writeFile);
    return readfile(filePath)
      .catch(function () { return '[]'; })
      .then(function (content) { return JSON.parse(content); })
      .then(function (content) {
        content.push(migrationName);
        return writefile(filePath, JSON.stringify(content, null, '  '));
      });
  }
logMigration ( migrationName ) { let filePath = this . path ; let readfile = Bluebird . promisify ( fs . readFile ) ; let writefile = Bluebird . promisify ( fs . writeFile ) ; return readfile ( filePath ) . catch ( function ( ) { return '[]' ; } ) . then ( function ( content ) { return JSON . parse ( content ) ; } ) . then ( function ( content ) { content . push ( migrationName ) ; return writefile ( filePath , JSON . stringify ( content , null , '  ' ) ) ; } ) ; }
Logs migration to be considered as executed.
Logs migration to be considered as executed .