Conversation
- Filter extension-owned functions from getDatabaseFunctions (excludes btree_gist etc) - Improve CHECK constraint normalization for semantic comparison (strip redundant parens) - Skip btree_gist CREATE EXTENSION when already installed Made-with: Cursor
Add normalizeSqlIdentifiers so (deleted = true) and ("deleted" = true) compare equal.
Prevents spurious DROP/ADD for period-related CHECK constraints when schema matches.
Made-with: Cursor
- Use Unicode placeholder to avoid identifier regex corrupting string literals - Store raw def for EXCLUDE/trigger down migrations (normalized only for comparison) - Strip parens from OR/AND operands so (a) OR (b) matches a OR b - Strip schema prefix from trigger def (ON public.table -> ON table) Made-with: Cursor
…gration - Canonicalize type aliases (timestamp with time zone -> timestamptz) - Strip redundant parens in WHERE clause via findMatchingParen - Fix normalizeSqlIdentifiers double-quoting (placeholder for quoted idents) - Add unit test for equivalent EXCLUDE def normalization Made-with: Cursor
… generator Made-with: Cursor
Made-with: Cursor
|
🎉 This PR is included in version 23.8.0-next.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 23.8.0-next.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
dwirz
requested changes
Mar 6, 2026
| - **`name`**: A short name for the constraint (used in migration constraint names). | ||
| - **`expression`**: A PostgreSQL boolean expression. Column names **must** be double-quoted (e.g. `"score"`) so they are validated against the model’s columns; unquoted identifiers are not checked. | ||
| - **`expression`**: A PostgreSQL boolean expression. Column names **must** be double-quoted (e.g. `"score"`) so they are validated against the model’s columns. | ||
| - **`message`** (optional): Human-readable message for when the constraint fails. Not used by graphql-magic; available for application-level error mapping. |
| const constraintName = this.getConstraintName(model, entry, i); | ||
| up.push(() => { | ||
| this.addCheckConstraint(table, constraintName, expression); | ||
| this.addConstraintTrigger(table, constraintName, entry); |
Member
There was a problem hiding this comment.
The docs say "The function must be defined in functions.ts", but this isn't enforced at generation time. If a user typos the function name, they'll only discover the error when the migration runs against Postgres. A validation step (checking parsedFunctions for the referenced function name) would catch this earlier.
|
🎉 This PR is included in version 23.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
No description provided.