不要怂,就是干,撸起袖子干!

Commit bc4fe8a3 by Sushant

docs(add-constraint): options.fields support

1 parent c624c0e1
...@@ -54,6 +54,12 @@ This method now tests for equality with [`_.isEqual`](https://lodash.com/docs/4. ...@@ -54,6 +54,12 @@ This method now tests for equality with [`_.isEqual`](https://lodash.com/docs/4.
This method now throws `Sequelize.AggregateError` instead of `Bluebird.AggregateError`. All errors are now exposed as `errors` key. This method now throws `Sequelize.AggregateError` instead of `Bluebird.AggregateError`. All errors are now exposed as `errors` key.
### QueryInterface
#### `addConstraint`
This method now only takes 2 parameters, `tableName` and `options`. Previously the second parameter could be a list of column names to apply the constraint to, this list must now be passed as `options.fields` property.
## Changelog ## Changelog
### 6.0.0-beta.5 ### 6.0.0-beta.5
......
...@@ -683,10 +683,10 @@ class QueryInterface { ...@@ -683,10 +683,10 @@ class QueryInterface {
* @param {string} tableName Table name where you want to add a constraint * @param {string} tableName Table name where you want to add a constraint
* @param {object} options An object to define the constraint name, type etc * @param {object} options An object to define the constraint name, type etc
* @param {string} options.type Type of constraint. One of the values in available constraints(case insensitive) * @param {string} options.type Type of constraint. One of the values in available constraints(case insensitive)
* @param {Array} options.fields Array of column names to apply the constraint over
* @param {string} [options.name] Name of the constraint. If not specified, sequelize automatically creates a named constraint based on constraint type, table & column names * @param {string} [options.name] Name of the constraint. If not specified, sequelize automatically creates a named constraint based on constraint type, table & column names
* @param {string} [options.defaultValue] The value for the default constraint * @param {string} [options.defaultValue] The value for the default constraint
* @param {object} [options.where] Where clause/expression for the CHECK constraint * @param {object} [options.where] Where clause/expression for the CHECK constraint
* @param {Array} [options.attributes] Array of column names to apply the constraint over
* @param {object} [options.references] Object specifying target table, column name to create foreign key constraint * @param {object} [options.references] Object specifying target table, column name to create foreign key constraint
* @param {string} [options.references.table] Target table name * @param {string} [options.references.table] Target table name
* @param {string} [options.references.field] Target column name * @param {string} [options.references.field] Target column name
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!