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

Commit eef1e88d by Emmanuel Gautier Committed by Simon Schick

docs: add index operator option (#10918)

1 parent 5fbc3a79
...@@ -477,6 +477,8 @@ class QueryGenerator { ...@@ -477,6 +477,8 @@ class QueryGenerator {
- length: An integer. Optional - length: An integer. Optional
- order: 'ASC' or 'DESC'. Optional - order: 'ASC' or 'DESC'. Optional
- parser - parser
- using
- operator
- concurrently: Pass CONCURRENT so other operations run while the index is created - concurrently: Pass CONCURRENT so other operations run while the index is created
- rawTablename, the name of the table, without schema. Used to create the name of the index - rawTablename, the name of the table, without schema. Used to create the name of the index
@private @private
......
...@@ -895,6 +895,7 @@ class Model { ...@@ -895,6 +895,7 @@ class Model {
* @param {string} [options.indexes[].name] The name of the index. Defaults to model name + _ + fields concatenated * @param {string} [options.indexes[].name] The name of the index. Defaults to model name + _ + fields concatenated
* @param {string} [options.indexes[].type] Index type. Only used by mysql. One of `UNIQUE`, `FULLTEXT` and `SPATIAL` * @param {string} [options.indexes[].type] Index type. Only used by mysql. One of `UNIQUE`, `FULLTEXT` and `SPATIAL`
* @param {string} [options.indexes[].using] The method to create the index by (`USING` statement in SQL). BTREE and HASH are supported by mysql and postgres, and postgres additionally supports GIST and GIN. * @param {string} [options.indexes[].using] The method to create the index by (`USING` statement in SQL). BTREE and HASH are supported by mysql and postgres, and postgres additionally supports GIST and GIN.
* @param {string} [options.indexes[].operator] Specify index operator.
* @param {boolean} [options.indexes[].unique=false] Should the index by unique? Can also be triggered by setting type to `UNIQUE` * @param {boolean} [options.indexes[].unique=false] Should the index by unique? Can also be triggered by setting type to `UNIQUE`
* @param {boolean} [options.indexes[].concurrently=false] PostgresSQL will build the index without taking any write locks. Postgres only * @param {boolean} [options.indexes[].concurrently=false] PostgresSQL will build the index without taking any write locks. Postgres only
* @param {Array<string|Object>} [options.indexes[].fields] An array of the fields to index. Each field can either be a string containing the name of the field, a sequelize object (e.g `sequelize.fn`), or an object with the following attributes: `attribute` (field name), `length` (create a prefix index of length chars), `order` (the direction the column should be sorted in), `collate` (the collation (sort order) for the column) * @param {Array<string|Object>} [options.indexes[].fields] An array of the fields to index. Each field can either be a string containing the name of the field, a sequelize object (e.g `sequelize.fn`), or an object with the following attributes: `attribute` (field name), `length` (create a prefix index of length chars), `order` (the direction the column should be sorted in), `collate` (the collation (sort order) for the column)
......
...@@ -632,6 +632,7 @@ class QueryInterface { ...@@ -632,6 +632,7 @@ class QueryInterface {
* @param {boolean} [options.concurrently] Pass CONCURRENT so other operations run while the index is created * @param {boolean} [options.concurrently] Pass CONCURRENT so other operations run while the index is created
* @param {boolean} [options.unique] Create a unique index * @param {boolean} [options.unique] Create a unique index
* @param {string} [options.using] Useful for GIN indexes * @param {string} [options.using] Useful for GIN indexes
* @param {string} [options.operator] Index operator
* @param {string} [options.type] Type of index, available options are UNIQUE|FULLTEXT|SPATIAL * @param {string} [options.type] Type of index, available options are UNIQUE|FULLTEXT|SPATIAL
* @param {string} [options.name] Name of the index. Default is <table>_<attr1>_<attr2> * @param {string} [options.name] Name of the index. Default is <table>_<attr1>_<attr2>
* @param {Object} [options.where] Where condition on index, for partial indexes * @param {Object} [options.where] Where condition on index, for partial indexes
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!