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

enhancement(database)!: shorten prefixes and suffixes used in identifiers #19783

Merged

Conversation

innerdvations
Copy link
Contributor

What does it do?

Use shorter prefixes and suffixes in generated metadata, for example using "cmps" instead of "components" and "lnk" instead of "links"

Why is it needed?

To make more space available for the actual names of content types and attribute in our database names

How to test it?

See #19732 and follow the same testing instructions. The only difference is that now suffixes and prefixes should also be renamed to the shorter versions.

Related issue(s)/PR(s)

The core migration without shorter prefixes and suffixes: #19732

@innerdvations innerdvations self-assigned this Mar 15, 2024
@innerdvations innerdvations added source: core:database Source is core/database package pr: enhancement This PR adds or updates some part of the codebase or features labels Mar 15, 2024
@innerdvations innerdvations added this to the 5.0.0 milestone Mar 15, 2024
@innerdvations innerdvations changed the title enhancement(database): shorten prefixes and suffixes enhancement(database): shorten prefixes and suffixes used in identifiers Mar 15, 2024
Copy link

vercel bot commented Mar 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2024 10:32am

@innerdvations innerdvations changed the title enhancement(database): shorten prefixes and suffixes used in identifiers enhancement(database)!: shorten prefixes and suffixes used in identifiers Mar 18, 2024
Comment on lines 138 to 140
* @param {NameToken[]} nameTokens - Array of name tokens
* @param {number} [maxLength] - Maximum length for the final name string.
* @param {NameFromTokenOptions} options - Name token options
* @returns {string} The generated name string within maxLength.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to keep those jsdoc tags since we already have the TS types

Copy link
Member

@Bassel17 Bassel17 left a comment

Choose a reason for hiding this comment

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

Just one comment, otherwise looks great

index: 'idx',
inv_fk: 'ifk',
order_fk: 'ofk',
id_column_index: 'idix',
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be shortened to something like this, i mean looking at how we are shortening index everywhere else

Suggested change
id_column_index: 'idix',
id_column_index: 'ididx',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used idix because that's what was in the RFC but I have no idea where that came from or why. If anyone wants to vote here, I'll go with whatever the consensus is, I don't think it's super important as long as we document it.

@innerdvations innerdvations merged commit 1a78eec into enhancement/short-db-names-migration Mar 20, 2024
80 of 82 checks passed
@innerdvations innerdvations deleted the enhancement/short-db-prefixes branch March 20, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: enhancement This PR adds or updates some part of the codebase or features source: core:database Source is core/database package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants