Skip to content

Commit

Permalink
docs(storages): update docs to match new Storage API
Browse files Browse the repository at this point in the history
  • Loading branch information
jukkah committed May 9, 2017
1 parent 4bdc10f commit 4cd9dd3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
35 changes: 15 additions & 20 deletions src/storages/sequelize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4cd9dd3

Please sign in to comment.