Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Composite index name too long #1944
So I was creating a table tonight with 6 fields put into a compound index per the docs.
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?
For M:M relations I found how to go around this problem. Create model for rm_userbizchallengeroadmaps and add keys (that will be foreign keys for connected tables):
That unique key is a solution to use own key instead of generating one. Then, in settings through options in both connected models, set parmetr unique: false :
For me, this works. I only found a problem when I use parameter alter: true in sync option and then I have 1 : M relations. Same error with long identifier appears but I didn't find way how to fix it except not enable ALTER parameter.
Please reopen this. This is a bug in
This line creates an index name for a BelongsToMany table, and if the name is longer than 64 characters it will fail on MySQL. On PostgreSQL I believe the name will be truncated to 63 chars, which also is not desirable.
Ideally I’d have the option to specify the index name myself.