-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3202 from antgonza/archive-biom
archive biom: back changes
- Loading branch information
Showing
8 changed files
with
176 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Jun 8, 2022 | ||
-- adding the new visibility level: archived | ||
|
||
INSERT INTO qiita.visibility (visibility, visibility_description) VALUES ('archived', 'Archived artifact'); | ||
|
||
-- update function to ignore archived artifacts | ||
CREATE OR REPLACE FUNCTION qiita.bioms_from_preparation_artifacts(prep_id bigint) RETURNS TEXT AS $$ | ||
DECLARE | ||
artifacts TEXT := NULL; | ||
BEGIN | ||
SELECT array_to_string(array_agg(artifact_id), ',') INTO artifacts | ||
FROM qiita.preparation_artifact | ||
LEFT JOIN qiita.artifact USING (artifact_id) | ||
LEFT JOIN qiita.artifact_type USING (artifact_type_id) | ||
LEFT JOIN qiita.software_command USING (command_id) | ||
LEFT JOIN qiita.software USING (software_id) | ||
LEFT JOIN qiita.visibility USING (visibility_id) | ||
WHERE | ||
prep_template_id = prep_id AND | ||
artifact_type = 'BIOM' AND | ||
NOT deprecated AND | ||
visibility != 'archived'; | ||
RETURN artifacts; | ||
END | ||
$$ LANGUAGE plpgsql; |
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