forked from hasura/graphql-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix event trigger cleanup on deletion via replace_metadata (fix hasur…
- Loading branch information
1 parent
c5f1392
commit f09d0cf
Showing
9 changed files
with
107 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
41 | ||
42 |
This file contains 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
This file contains 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,2 @@ | ||
ALTER TABLE hdb_catalog.event_triggers | ||
DROP CONSTRAINT event_triggers_schema_name_table_name_fkey; |
This file contains 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,5 @@ | ||
ALTER TABLE hdb_catalog.event_triggers | ||
ADD CONSTRAINT event_triggers_schema_name_table_name_fkey | ||
FOREIGN KEY (schema_name, table_name) | ||
REFERENCES hdb_catalog.hdb_table(table_schema, table_name) | ||
ON UPDATE CASCADE; |
68 changes: 46 additions & 22 deletions
68
server/tests-py/queries/event_triggers/create-delete/create_and_reset.yaml
This file contains 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 |
---|---|---|
@@ -1,26 +1,50 @@ | ||
description: create an event trigger and then reset metadata | ||
url: /v1/query | ||
status: 200 | ||
query: | ||
type: bulk | ||
args: | ||
- type: track_table | ||
- description: create an event trigger and then reset metadata | ||
url: /v1/query | ||
status: 200 | ||
query: | ||
type: bulk | ||
args: | ||
schema: hge_tests | ||
name: test_t1 | ||
- type: create_event_trigger | ||
args: &def_args | ||
name: t1_1 | ||
table: | ||
- type: track_table | ||
args: | ||
schema: hge_tests | ||
name: test_t1 | ||
insert: | ||
columns: "*" | ||
update: | ||
columns: "*" | ||
delete: | ||
columns: "*" | ||
webhook: http://127.0.0.1:5592 | ||
- type: create_event_trigger | ||
args: &def_args | ||
name: t1_1 | ||
table: | ||
schema: hge_tests | ||
name: test_t1 | ||
insert: | ||
columns: "*" | ||
update: | ||
columns: "*" | ||
delete: | ||
columns: "*" | ||
webhook: http://127.0.0.1:5592 | ||
- type: insert | ||
args: | ||
table: | ||
schema: hge_tests | ||
name: test_t1 | ||
objects: | ||
- c1: 1 | ||
c2: world | ||
returning: [] | ||
- type: clear_metadata | ||
args: {} | ||
|
||
- type: clear_metadata | ||
args: {} | ||
- description: ensure the event was archived | ||
url: /v1/query | ||
status: 200 | ||
response: | ||
- trigger_name: t1_1 | ||
archived: true | ||
query: | ||
type: select | ||
args: | ||
table: | ||
schema: hdb_catalog | ||
name: event_log | ||
columns: [trigger_name, archived] | ||
order_by: ['-created_at'] | ||
limit: 1 |