Skip to content

Composite index name too long #1944

@baliw

Description

@baliw

So I was creating a table tonight with 6 fields put into a compound index per the docs.

field: {type:Sequelize.STRING(34), unique:'main'},
another_field: {type:Sequelize.STRING(34), unique:'main'},
a_date_field: {type:Sequelize.STRING(34), unique:'main'},
yet_another_field: {type:Sequelize.STRING(34), unique:'main'},
almost_done_field: {type:Sequelize.STRING(34), unique:'main'},
last_field: {type:Sequelize.STRING(34), unique:'main'}

I'm getting an error from MySQL. ER_TOO_LONG_IDENT "Identifier name is too long".

Sequelize is combining my field names to create an index name rather than using the 'main' string I'm providing.

Is there a way to provide the index name to avoid this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    dialect: mariadbFor issues and PRs. Things that involve MariaDB (and do not involve all dialects).dialect: mysqlFor issues and PRs. Things that involve MySQL (and do not involve all dialects).existing workaroundFor issues. There is a known workaround for this issue.type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions