Repository navigation
Description
Issue Creation Checklist
- I understand that my issue will be automatically closed if I don't fill in the requested information
- I have read the contribution guidelines
Bug Description
In packages/core/test/integration/model.test.js, test name 'should allow the user to specify indexes in options', method: 'BTREE' is used for creating an index. However, the BTREE is not reflected in the generated SQL.
| method: 'BTREE', |
I guess the reason is that packages/core/src/abstract-dialect/query-generator.js#addIndexQuery() is using using field as index type, not method field.
| this.dialect.supports.index.using === 1 && options.using ? `USING ${options.using}` : '', |
Reproducible Example
Here is the link to the SSCCE for this issue:
yarn lerna run test-integration-mysqlWhat do you expect to happen?
Test name 'should allow the user to specify indexes in options'.
Index type 'BTREE' should be used in the SQL statement.
ALTER TABLE `models` ADD UNIQUE INDEX `a_b_uniq` USING BTREE (`fieldB`, `fieldA`(5) ASC)What is actually happening?
The SQL statement does not contain 'BTREE'.
ALTER TABLE `models` ADD UNIQUE INDEX `a_b_uniq` (`fieldB`, `fieldA`(5) ASC)Environment
- Sequelize version: latest
mainbranch - Node.js version: 20.11.1
- If TypeScript related: TypeScript version: N/A
- Database & Version: MySQL latest docker image for integration test
- Connector library & Version: mysql2 3.9.7
Would you be willing to resolve this issue by submitting a Pull Request?
- Yes, I have the time and I know how to start.
- Yes, I have the time but I will need guidance.
- No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
- No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.
Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.
Metadata
Metadata
Assignees
Labels
No labels
Activity
lohart13 commentedon Oct 7, 2024
PR #16227 should fix this this issue.
The
methodoption has been renamed tousing.An error will be displayed if the user using the wrong option.