2017-05-05 16:59:37 +00:00
|
|
|
-- name: config-find-id
|
|
|
|
|
|
|
|
SELECT
|
2019-06-11 08:50:50 +00:00
|
|
|
config.config_id
|
2017-05-05 16:59:37 +00:00
|
|
|
,config_repo_id
|
|
|
|
,config_hash
|
|
|
|
,config_data
|
2019-06-07 08:40:16 +00:00
|
|
|
,config_name
|
2017-05-05 16:59:37 +00:00
|
|
|
FROM config
|
2019-06-11 08:50:50 +00:00
|
|
|
LEFT JOIN build_config ON config.config_id = build_config.config_id
|
|
|
|
WHERE build_config.build_id = ?
|
2017-05-05 16:59:37 +00:00
|
|
|
|
|
|
|
-- name: config-find-repo-hash
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
config_id
|
|
|
|
,config_repo_id
|
|
|
|
,config_hash
|
|
|
|
,config_data
|
2019-06-07 08:40:16 +00:00
|
|
|
,config_name
|
2017-05-05 16:59:37 +00:00
|
|
|
FROM config
|
|
|
|
WHERE config_repo_id = ?
|
|
|
|
AND config_hash = ?
|
2017-05-05 18:05:42 +00:00
|
|
|
|
|
|
|
-- name: config-find-approved
|
|
|
|
|
|
|
|
SELECT build_id FROM builds
|
|
|
|
WHERE build_repo_id = ?
|
2019-06-11 08:50:50 +00:00
|
|
|
AND build_id in (
|
|
|
|
SELECT build_id
|
|
|
|
FROM build_config
|
|
|
|
WHERE build_config.config_id = ?
|
|
|
|
)
|
2017-05-05 18:05:42 +00:00
|
|
|
AND build_status NOT IN ('blocked', 'pending')
|
|
|
|
LIMIT 1
|