-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: core:content-type-builderSource is core/content-type-builder packageSource is core/content-type-builder packagesource: core:databaseSource is core/database packageSource is core/database packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
Description
Bug report
Describe the bug
Longer names within components and collections can lead to an error saving to the database due column/table name character restriction limits.
Steps to reproduce the behavior
- Create any two collections or combination of a collection + component.
- Give one or both medium to long names. The two I used:
Collection name: test_articles
Component category: test_category
Component name: my_articles_longer_name
- Add a relation field in the component that is one to many to the collection you just created.
- Save
- See error in strapi console/terminal
[2022-01-04 16:03:17.855] error: alter table `components_test_category_my_longer_names_test_article_links` add index
`components_test_category_my_longer_names_test_article_links_inv_fk`(`test_article_id`) -
ER_TOO_LONG_IDENT: Identifier name 'components_test_category_my_longer_names_test_article_links_inv_fk' is too long
Error: ER_TOO_LONG_IDENT: Identifier name 'components_test_category_my_longer_names_test_article_links_inv_fk' is too long
Expected behavior
Expect to have the ability to either customize the column names or have longer than short collection/component names without going over the database restriction.
System
- Node.js version: 16.7.0
- NPM version: 7.20.3
- Strapi version: 4.0.2
- Database: MYSQL 5.7
- Operating system: MacOS Big Sur
Additional information
Current workaround:
Manually editing the collectionName in the respective JSON file will rename in the database.
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: core:content-type-builderSource is core/content-type-builder packageSource is core/content-type-builder packagesource: core:databaseSource is core/database packageSource is core/database packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
