-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add connection type and get connections
- Loading branch information
Showing
19 changed files
with
645 additions
and
553 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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE `goal` ADD COLUMN `connection_type` INT NOT NULL DEFAULT 0 AFTER `description`; |
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
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,13 @@ | ||
INSERT INTO goal ( | ||
id, | ||
name, | ||
description, | ||
connection_type, | ||
archived, | ||
deleted, | ||
created_at, | ||
updated_at, | ||
environment_id | ||
) VALUES ( | ||
?, ?, ?, ?, ?, ?, ?, ?, ? | ||
) |
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,32 @@ | ||
SELECT | ||
id, | ||
name, | ||
description, | ||
connection_type, | ||
archived, | ||
deleted, | ||
created_at, | ||
updated_at, | ||
CASE | ||
WHEN ( | ||
SELECT | ||
COUNT(1) | ||
FROM | ||
experiment ex1 | ||
WHERE | ||
ex1.environment_id = ? AND | ||
ex1.goal_ids LIKE concat("%", goal.id, "%") | ||
) > 0 THEN TRUE | ||
ELSE FALSE | ||
END AS is_in_use_status, | ||
( | ||
select | ||
CONCAT('[', GROUP_CONCAT(JSON_OBJECT('id', ex2.id, 'name', ex2.name)), ']') | ||
from experiment ex2 | ||
where json_contains(ex2.goal_ids, concat('"', goal.id, '"'), '$') | ||
) as experiments | ||
FROM | ||
goal | ||
WHERE | ||
id = ? AND | ||
environment_id = ? |
Oops, something went wrong.