fix: resolves Postgres sequence identifier length error#7115
Merged
pleerock merged 1 commit intotypeorm:masterfrom Jan 12, 2021
Merged
fix: resolves Postgres sequence identifier length error#7115pleerock merged 1 commit intotypeorm:masterfrom
pleerock merged 1 commit intotypeorm:masterfrom
Conversation
pleerock
reviewed
Jan 11, 2021
| } | ||
|
|
||
| let seqName = `${tableName}_${columnName}_seq`; | ||
| if (seqName.length > 63) // note doesn't yet handle corner cases where .length differs from number of UTF-8 bytes |
Member
There was a problem hiding this comment.
instead of hard-coded magic value 63 I would recommend to use Driver.maxAliasLength property.
Member
There was a problem hiding this comment.
I think in all other places we already use a shorten function to shorten things... Can we use it here as well to achieve consistency?
Contributor
Author
There was a problem hiding this comment.
I have pushed an amended commit that uses the maxAliasLength property. I have not used shorten because it doesn't match the truncation algorithm that Postgres uses, thus won't fix the issue.
Changes the sequence name generator to handle cases where PostgreSQL auto-generated sequence name differed from TypeORM generated sequence name. Closes: typeorm#7106
a8dde23 to
8720d44
Compare
Contributor
Author
|
In the failing circleci test, it does pass the additional test, however there was a segfault that occurred later for some reason unrelated to the latest change. |
Member
|
Thank you for contribution! 🎉 |
This was referenced Mar 15, 2021
zshipleyTAG
pushed a commit
to Amherst-Development/typeorm
that referenced
this pull request
Oct 7, 2022
* typeorm-0.2.30: (212 commits) version bump docs: fix javascript usage examples (typeorm#7031) fix: resolve migration for UpdateDateColumn without ON UPDATE clause (typeorm#7057) fix: Error when sorting by an embedded entity while using join and skip/take (typeorm#7082) fix: resolves Postgres sequence identifier length error (typeorm#7115) feat: closure table custom naming (typeorm#7120) feat: relations: Orphaned row action (typeorm#7105) docs: fix invalid code block in "find many options" (typeorm#7268) docs: Embodying the example (typeorm#7116) docs: document withDeleted option (typeorm#7132) fix: return 'null' (instead of 'undefined') on lazy relations that have no results (typeorm#7146) (typeorm#7147) docs: update cascade options (typeorm#7140) docs: add .ts to supported ormconfig formats (typeorm#7139) fix: improve stack traces when using persist executor (typeorm#7218) refactor: remove Oracle multirow insert workaround (since typeorm#6927) (typeorm#7083) feat: add NOWAIT and SKIP LOCKED lock support for MySQL (typeorm#7236) docs: update OneToMany grammar (typeorm#7252) feat: JavaScript file migrations output (typeorm#7253) docs: update Repository.ts (typeorm#7254) chore: update dependency cli-highlight to v2.1.10 (typeorm#7265) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes the sequence name generator to handle cases where PostgreSQL auto-generated sequence name differed from TypeORM generated sequence name.
Closes: #7106
Description of change
Current behaviour: sequence name generator for PostgreSQL does not match PostgreSQL automatic sequence name implementation for some cases.
New behaviour: now it does.
Pull-Request Checklist
masterbranchnpm run lintpasses with this changenpm run testpasses with this changeFixes #0000