From e7b14b22c38ed83e5d0d8c473c1c65423e11c9bd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 15 Feb 2018 13:13:57 +0100 Subject: bin/bootstrap-mysql: create `repository_stability_relations` --- bin/bootstrap-mysql | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'bin/bootstrap-mysql') diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 1a50496..c965319 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -133,7 +133,10 @@ if [ ! "$1" = 'slim' ]; then ' description VARCHAR(512)' 'todo_links MEDIUMINT' \ ' dependent MEDIUMINT' \ - ' depending_on MEDIUMINT' + ' depending_on MEDIUMINT' \ + 'repository_stability_relations MEDIUMINT' \ + ' more_stable MEDIUMINT :repository_stabilities' \ + ' less_stable MEDIUMINT :repository_stabilities' ) { @@ -396,6 +399,30 @@ fi } | \ sed 's|,;|;|' + # shellcheck disable=SC2016 + { + printf 'INSERT IGNORE INTO `repository_stability_relations` (`more_stable`,`less_stable`)' + printf ' SELECT `ms`.`id`,`ls`.`id`' + printf ' FROM `repository_stabilities` AS `ms` JOIN `repository_stabilities` AS `ls`' + printf ' WHERE ' + printf '(`ms`.`name`="%s" AND `ls`.`name`="%s") OR ' \ + 'stable' 'stable' \ + 'stable' 'testing' \ + 'stable' 'staging' \ + 'stable' 'unbuilt' \ + 'stable' 'forbidden' \ + 'testing' 'testing' \ + 'testing' 'staging' \ + 'testing' 'unbuilt' \ + 'testing' 'forbidden' \ + 'staging' 'staging' \ + 'staging' 'unbuilt' \ + 'staging' 'forbidden' \ + 'unbuilt' 'forbidden' + printf ';\n' + } | \ + sed 's| OR ;|;|' + for repo in \ 'core:stable:AQ==' \ 'extra:stable:AQ==' \ -- cgit v1.2.3-70-g09d2