-
Notifications
You must be signed in to change notification settings - Fork 1
feat(metaschema-modules): add events_module.record_error #126
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...y/schemas/metaschema_modules_public/tables/events_module/alterations/add_record_error.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| -- Deploy schemas/metaschema_modules_public/tables/events_module/alterations/add_record_error to pg | ||
|
|
||
| -- requires: schemas/metaschema_modules_public/tables/events_module/table | ||
|
|
||
| BEGIN; | ||
|
|
||
| -- Generated private function that records a refused operation under its error | ||
| -- code as the event name; the server discovers it here, beside record_event. | ||
| ALTER TABLE metaschema_modules_public.events_module | ||
| ADD COLUMN record_error text NOT NULL DEFAULT ''; | ||
|
|
||
| COMMIT; |
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
8 changes: 8 additions & 0 deletions
8
...t/schemas/metaschema_modules_public/tables/events_module/alterations/add_record_error.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- Revert schemas/metaschema_modules_public/tables/events_module/alterations/add_record_error from pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| ALTER TABLE metaschema_modules_public.events_module | ||
| DROP COLUMN record_error; | ||
|
|
||
| COMMIT; |
Binary file modified
BIN
+515 Bytes
(100%)
packages/metaschema-modules/sql/metaschema-modules--0.44.0.bundle.tar.gz
Binary file not shown.
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
7 changes: 7 additions & 0 deletions
7
...y/schemas/metaschema_modules_public/tables/events_module/alterations/add_record_error.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Verify schemas/metaschema_modules_public/tables/events_module/alterations/add_record_error on pg | ||
|
|
||
| BEGIN; | ||
|
|
||
| SELECT record_error FROM metaschema_modules_public.events_module WHERE FALSE; | ||
|
|
||
| ROLLBACK; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 bug · medium
Hand-edit generated SQL bundle artifact
The generated bundle
packages/metaschema-modules/sql/metaschema-modules--0.44.0.sqlwas hand-edited to append theALTER TABLE ... ADD COLUMN record_errorstatement (packages/metaschema-modules/sql/metaschema-modules--0.44.0.sql:6562), but AGENTS.md requires this artifact to be regenerated viapgpm packageand never edited by hand. Hand-editing breaks the byte-reproducibility guarantee and can leave the committed bundle diverging from whatdeploy/+pgpm.planwould produce, causing deploy inconsistencies.📋 Prompt for AI Agents
In packages/metaschema-modules/sql/metaschema-modules--0.44.0.sql, delete lines 6562-6565 (the hand-appended ALTER TABLE ... ADD COLUMN record_error block). Then run
pgpm packagein the metaschema-modules directory so the bundle artifact is regenerated from deploy/ and pgpm.plan, and commit the regenerated artifact together with the deploy change.