-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3099: Cache component name in fix to optimize fetching them r=paulocsanz a=paulocsanz 3100: Enable compression in services r=paulocsanz a=paulocsanz Co-authored-by: Paulo Cabral <[email protected]>
- Loading branch information
Showing
17 changed files
with
325 additions
and
87 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
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,35 @@ | ||
ALTER TABLE fixes ADD COLUMN component_name TEXT; | ||
UPDATE fixes SET component_name = ''; | ||
ALTER TABLE fixes ALTER COLUMN component_name SET NOT NULL; | ||
|
||
CREATE OR REPLACE FUNCTION fix_create_v2( | ||
this_tenancy jsonb, | ||
this_visibility jsonb, | ||
this_component_id ident, | ||
this_component_name text, | ||
this_action_prototype_id ident, | ||
OUT object json) AS | ||
$$ | ||
DECLARE | ||
this_tenancy_record tenancy_record_v1; | ||
this_visibility_record visibility_record_v1; | ||
this_new_row fixes%ROWTYPE; | ||
this_action_kind text; | ||
BEGIN | ||
this_tenancy_record := tenancy_json_to_columns_v1(this_tenancy); | ||
this_visibility_record := visibility_json_to_columns_v1(this_visibility); | ||
|
||
SELECT | ||
INTO STRICT this_action_kind | ||
kind FROM action_prototypes_v1($1, $2) where id = this_action_prototype_id; | ||
|
||
INSERT INTO fixes (tenancy_workspace_pk, visibility_change_set_pk, | ||
component_id, component_name, action_prototype_id, action_kind) | ||
VALUES (this_tenancy_record.tenancy_workspace_pk, | ||
this_visibility_record.visibility_change_set_pk, | ||
this_component_id, this_component_name, this_action_prototype_id, this_action_kind) | ||
RETURNING * INTO this_new_row; | ||
|
||
object := row_to_json(this_new_row); | ||
END | ||
$$ LANGUAGE PLPGSQL VOLATILE; |
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
Oops, something went wrong.