Skip to content
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

Merged
merged 2 commits into from
Oct 20, 2021
Merged

Add storage engine index type doc #4756 #345

merged 2 commits into from
Oct 20, 2021

Conversation

OlivierCavadenti
Copy link
Collaborator

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])",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing spaces

@@ -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']})",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing spaces

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.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specified between sounds off

@@ -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'})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing spaces.

@@ -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])",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing spaces.

@kibertoad kibertoad merged commit db9f325 into knex:gh-pages Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants