-
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.
issue #22: refactor incoming_to_model, split out testing, split triggers
- Loading branch information
Showing
21 changed files
with
196 additions
and
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | ||
-- CREATE EXTENSION IF NOT EXISTS postgres_fdw; | ||
CREATE EXTENSION IF NOT EXISTS unaccent; | ||
CREATE EXTENSION IF NOT EXISTS pgcrypto; | ||
CREATE EXTENSION IF NOT EXISTS citext; | ||
|
||
CREATE EXTENSION IF NOT EXISTS citext; | ||
-- CREATE EXTENSION IF NOT EXISTS pgtap; | ||
CREATE EXTENSION IF NOT EXISTS citext; |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
\ir api/schema.sql | ||
\ir api/snapshot.sql | ||
\ir api/warnings.sql | ||
\ir api/functions.sql | ||
\ir api/functions.sql |
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,2 @@ | ||
\ir model/functions.sql | ||
\ir model/api.snapshot.trigger.sql |
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,3 +1,4 @@ | ||
|
||
-- postgraphql interface | ||
\ir postgraphql/postgraphql.sql | ||
\ir postgraphql/postgraphql.sql | ||
\ir postgraphql/model.entry.trigger.sql |
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 @@ | ||
-- import facilities | ||
\ir api/update_from_server.sql |
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,3 +1,4 @@ | ||
\ir 003-psql-create-extensions-localhost.sql | ||
\ir test/schema.sql | ||
\ir test/api.sql | ||
\ir test/test.utils.sql | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CREATE OR REPLACE FUNCTION model.convert_incoming_to_model_trigger() RETURNS trigger AS | ||
$convert_incoming_to_model_trigger$ | ||
BEGIN | ||
|
||
PERFORM * FROM api.warnings WHERE id = NEW.id; | ||
IF FOUND THEN | ||
RETURN NEW; | ||
END IF; | ||
PERFORM model.convert_incoming_to_model(NEW.id); | ||
RETURN NEW; | ||
END; | ||
$convert_incoming_to_model_trigger$ LANGUAGE PLPGSQL; | ||
|
||
DROP TRIGGER IF EXISTS model_update ON api.snapshot; | ||
|
||
CREATE TRIGGER model_update | ||
AFTER INSERT OR UPDATE ON api.snapshot | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE model.convert_incoming_to_model_trigger(); |
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
Oops, something went wrong.