-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add storage engine index type doc #4756 #345
Add storage engine index type doc #4756 #345
Conversation
OlivierCavadenti
commented
Oct 20, 2021
- Documentation for Add storage engine index Type support to MySQL index() and unique() schema knex#4756
sections/schema.js
Outdated
example: "table.index(columns, [indexName], [indexType])", | ||
description: "Adds an index to a table over the given columns. A default index name using the columns is used unless indexName is specified. The indexType can be optionally specified for PostgreSQL and MySQL. Amazon Redshift does not allow creating an index.", | ||
children: [ ] | ||
example: "table.index(columns,[indexName]|{[indexName: string],[storageEngineIndexType:'btree'|'hash']}, [indexType])", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces
sections/schema.js
Outdated
@@ -798,8 +798,8 @@ export default [ | |||
type: "method", | |||
method: "unique", | |||
href:"Schema-table-unique", | |||
example: "table.unique(columns, options={[indexName:string],[deferrable:'not deferrable'|'immediate'|'deferred']})", | |||
description: "Adds an unique index to a table over the given `columns`. A default index name using the columns is used unless indexName is specified. If you need to create a composite index, pass an array of column to `columns`. Deferrable unique constraint are supported on Postgres and Oracle and can be set by passing deferrable option to options object.", | |||
example: "table.unique(columns, options={[indexName:string],[deferrable:'not deferrable'|'immediate'|'deferred'],[storageEngineIndexType:'btree'|'hash']})", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces
sections/schema.js
Outdated
example: "table.unique(columns, options={[indexName:string],[deferrable:'not deferrable'|'immediate'|'deferred']})", | ||
description: "Adds an unique index to a table over the given `columns`. A default index name using the columns is used unless indexName is specified. If you need to create a composite index, pass an array of column to `columns`. Deferrable unique constraint are supported on Postgres and Oracle and can be set by passing deferrable option to options object.", | ||
example: "table.unique(columns, options={[indexName:string],[deferrable:'not deferrable'|'immediate'|'deferred'],[storageEngineIndexType:'btree'|'hash']})", | ||
description: "Adds an unique index to a table over the given `columns`. In MySQL, the storage engine index type can be specified between 'btree' or 'hash' index types, more info in Index Options section : https://dev.mysql.com/doc/refman/8.0/en/create-index.html. A default index name using the columns is used unless indexName is specified. If you need to create a composite index, pass an array of column to `columns`. Deferrable unique constraint are supported on Postgres and Oracle and can be set by passing deferrable option to options object.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specified between
sounds off
sections/schema.js
Outdated
@@ -809,7 +809,7 @@ export default [ | |||
t.unique('email') | |||
}) | |||
knex.schema.alterTable('job', function(t) { | |||
t.unique(['account_id', 'program_id'],{indexName:'users_composite_index',deferrable:'deferred'}) | |||
t.unique(['account_id', 'program_id'],{indexName:'users_composite_index',deferrable:'deferred',storageEngineIndexType: 'hash'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces.
sections/schema.js
Outdated
@@ -957,8 +957,8 @@ export default [ | |||
{ | |||
type: "method", | |||
method: "index", | |||
example: "column.index([indexName], [indexType])", | |||
description: "Specifies a field as an index. If an indexName is specified, it is used in place of the standard index naming convention of tableName_columnName. The indexType can be optionally specified for PostgreSQL and MySQL. No-op if this is chained off of a field that cannot be indexed.", | |||
example: "column.index([indexName]|{[indexName: string],[storageEngineIndexType:'btree'|'hash']}, [indexType])", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing spaces.