From 4cd9dd3f0b2a0febb31e2b6f39cac96602b34d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Hyyti=C3=A4l=C3=A4?= Date: Thu, 4 May 2017 19:38:31 +0300 Subject: [PATCH] docs(storages): update docs to match new Storage API --- README.md | 7 ++----- src/storages/sequelize.js | 35 +++++++++++++++-------------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index a739e3ee..2b1b1dff 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,8 @@ var Bluebird = require('bluebird'); var redefine = require('redefine'); module.exports = redefine.Class({ - constructor: function (options) { - this.options = options; - this.options.storageOptions = _.extend({ - option1: 'defaultValue1' - }, this.options.storageOptions) + constructor: function ({ option1: 'defaultValue1' } = {}) { + this.option1 = option1; }, logMigration: function (migrationName) { diff --git a/src/storages/sequelize.js b/src/storages/sequelize.js index 29153844..34a8e257 100644 --- a/src/storages/sequelize.js +++ b/src/storages/sequelize.js @@ -21,26 +21,21 @@ module.exports = class SequelizeStorage { * If the table does not exist it will be created automatically. * * @param {Object} [options] - * @param {Object} [options.storageOptions] - * @param {Object} [options.storageOptions.sequelize] - configured instance of - * Sequelize. - * @param {Object} [options.storageOptions.model] - Sequelize model - must - * have column name matching "columnName" option. - * @param {String} [options.storageOptions.modelName='SequelizeMeta'] - name - * of model to create if "model" option is not supplied. - * @param {String} [options.storageOptions.tableName=modelName] - name of - * table to create if "model" option is not supplied. - * @param {String} [options.storageOptions.schema=schema] - name of the schema - * to create the table under, defaults to undefined. - * @param {String} [options.storageOptions.columnName='name'] - name of table - * column holding migration name. - * @param {String} [options.storageOptions.columnType=Sequelize.STRING] - type - * of the column. For utf8mb4 charsets under InnoDB, you may need to set - * this <= 190. - * @param {Boolean} [options.storageOptions.timestamps=false] - option to add - * timestamps to model table - * - * @constructs SequelizeStorage + * @param {Object} [options.] + * @param {Object} [options.sequelize] - configured instance of Sequelize. + * @param {Object} [options.model] - Sequelize model - must have column name + * matching "columnName" option. + * @param {String} [options.modelName='SequelizeMeta'] - name of the model + * to create if "model" option is not supplied. + * @param {String} [options.tableName=modelName] - name of the table to create + * if "model" option is not supplied. + * @param {String} [options.schema=schema] - name of the schema to create + * the table under, defaults to undefined. + * @param {String} [options.columnName='name'] - name of the table column + * holding migration name. + * @param {String} [options.columnType=Sequelize.STRING] - type of the column. + * For utf8mb4 charsets under InnoDB, you may need to set this <= 190. + * @param {Boolean} [options.timestamps=false] - option to add timestamps to the model table */ constructor({ sequelize,