From 09e4e9d45db1f445d916f17c6296eabf65485ed9 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 17 Apr 2018 14:31:10 +0200 Subject: new tables in database and dump --- misc/database-layout.dmf | 1420 ++++++++++++++++++++++----------------------- misc/database-layout.dump | 357 ++++++++++++ 2 files changed, 1067 insertions(+), 710 deletions(-) create mode 100644 misc/database-layout.dump diff --git a/misc/database-layout.dmf b/misc/database-layout.dmf index 069f4b3..7b61d9b 100644 --- a/misc/database-layout.dmf +++ b/misc/database-layout.dmf @@ -2,13 +2,13 @@ Relational - + - 237 - 40 + 42 + 135 - ssh_keys + ssh_log#ffffff @@ -18,13 +18,25 @@ True - owner + date + DATETIME + True + False + + + build_slave MEDIUMINT + False + False + + + action + VARCHAR(32) True False - fingerprint + parameters TEXT True False @@ -32,102 +44,108 @@
- + - -69 - 71 + -55 + -72 - email_actions + email_log#ffffff id - MEDIUMINT + BIGINT True True - name - VARCHAR(32) + date + DATETIME True False - -
-
- - - 68 - 49 - - - allowed_email_actions - #ffffff - - id - BIGINT + success + BIT True - True + False + + + action + MEDIUMINT + False + False + + + count + MEDIUMINT + False + False gpg_key BIGINT - True + False False - action - MEDIUMINT - True + comment + TEXT + False False
- + - 106 - -51 + 481 + 395 - gpg_keys + repository_moves#ffffff id - BIGINT + MEDIUMINT True True - fingerprint - VARCHAR(40) + from_repository + MEDIUMINT True False - owner + to_repository MEDIUMINT True False + + upstream_package_repository + SMALLINT + True + False +
- + - 257 - -44 + 763 + 241 - persons + repository_stabilities#ffffff id - MEDIUMINT + SMALLINT True True @@ -137,26 +155,38 @@ True False + + bugtracker_category + VARCHAR(32) + False + False +
- + - 974 - 255 + 52 + 516 - todo_links + build_dependency_loops#ffffff - dependent + id BIGINT True + True + + + loop + MEDIUMINT + True False - depending_on + build_assignment BIGINT True False @@ -164,55 +194,49 @@
- + - 1142 - 235 + 540 + -64 - todos + dependency_types#ffffff id - BIGINT + SMALLINT True True - file - VARCHAR(64) + name + VARCHAR(32) True False - line - MEDIUMINT + relevant_for_building + BIT True False - description - TEXT + relevant_for_binary_packages + BIT True False - - importance - SMALLINT - False - False -
- + - 1002 - 9 + 348 + -60 - statitstics + dependencies#ffffff @@ -222,249 +246,213 @@ True - date - DATETIME - True - False - - - stable_packages_count - MEDIUMINT - True - False - - - pending_tasks_count - MEDIUMINT - True - False - - - staging_packages_count - MEDIUMINT - True - False - - - testing_packages_count - MEDIUMINT - True - False - - - broken_tasks_count - MEDIUMINT - True - False - - - dependency_loops_count - MEDIUMINT + dependent + BIGINT True False - dependency_looped_tasks_count - MEDIUMINT + depending_on + BIGINT True False - locked_tasks_count - MEDIUMINT + dependency_type + SMALLINT True False + +
+
+ + + 563 + 42 + + + install_targets + #ffffff + - blocked_tasks_count - MEDIUMINT + id + BIGINT True - False + True - next_tasks_count - MEDIUMINT + name + VARCHAR(64) True False
- + - 754 - 399 + 415 + 321 - repository_stability_relations + architectures#ffffff id - MEDIUMINT + SMALLINT True True - more_stable - MEDIUMINT - True - False - - - less_stable - MEDIUMINT + name + VARCHAR(16) True False
- + - 51 - 244 + 229 + 471 - fail_reasons + package_sources#ffffff id - SMALLINT + BIGINT True True - name - VARCHAR(32) + pkgbase + VARCHAR(64) True False - identifier - VARCHAR(64) + git_revision + VARCHAR(40) True False - severity - SMALLINT + mod_git_revision + VARCHAR(40) True False - -
-
- - - 53 - 346 - - - failed_builds - #ffffff - - id - MEDIUMINT + upsream_package_repository + SMALLINT True - True + False - build_slave - MEDIUMINT + uses_upstream + BIT True False - build_assignment - BIGINT + uses_modification + BIT True False - date + commit_time DATETIME True False + +
+
+ + + 539 + 533 + + + upstream_repositories + #ffffff + - reason + id SMALLINT True + True + + + name + VARCHAR(64) + True False - log_file - VARCHAR(512) + git_repository + SMALLINT True False
- + - 247 - 291 + 770 + 508 - build_assignments + git_repositories#ffffff id - BIGINT + SMALLINT True True - package_source - BIGINT - True - False - - - architecture - SMALLINT + name + VARCHAR(64) True False - is_blocked + url VARCHAR(128) - False + True False - is_black_listed + directory VARCHAR(128) - False - False - - - is_broken - BIT True False - priority - SMALLINT + head + VARCHAR(40) True False
- + - 186 - 137 + 529 + 273 - build_slaves + repositories#ffffff @@ -475,38 +463,50 @@ name - VARCHAR(32) + VARCHAR(64) True False - ssh_key - BIGINT + stability + SMALLINT True False - currently_building - BIGINT - False + is_on_master_mirror + BIT + True False + +
+
+ + + 553 + 131 + + + install_target_providers + #ffffff + - last_connection - TIME + id + BIGINT True - False + True - logged_lines + package BIGINT - False + True False - last_action - VARCHAR(32) - False + install_target + BIGINT + True False @@ -602,121 +602,169 @@
- + - 553 - 131 + 186 + 137 - install_target_providers + build_slaves#ffffff id - BIGINT + MEDIUMINT True True - package + name + VARCHAR(32) + True + False + + + ssh_key BIGINT True False - install_target + currently_building BIGINT + False + False + + + last_connection + TIME True False + + logged_lines + BIGINT + False + False + + + last_action + VARCHAR(32) + False + False +
- + - 529 - 273 + 247 + 291 - repositories + build_assignments#ffffff id - MEDIUMINT + BIGINT True True - name - VARCHAR(64) + package_source + BIGINT True False - stability + architecture SMALLINT True False - is_on_master_mirror + is_blocked + VARCHAR(128) + False + False + + + is_black_listed + VARCHAR(128) + False + False + + + is_broken BIT True False + + priority + SMALLINT + True + False +
- + - 770 - 508 + 53 + 346 - git_repositories + failed_builds#ffffff id - SMALLINT + MEDIUMINT True True - name - VARCHAR(64) + build_slave + MEDIUMINT True False - url - VARCHAR(128) + build_assignment + BIGINT True False - directory - VARCHAR(128) + date + DATETIME True False - head - VARCHAR(40) + reason + SMALLINT + True + False + + + log_file + VARCHAR(512) True False
- + - 539 - 533 + -62 + 370 - upstream_repositories + fail_reasons#ffffff @@ -727,12 +775,18 @@ name - VARCHAR(64) + VARCHAR(32) True False - git_repository + identifier + VARCHAR(64) + True + False + + + severity SMALLINT True False @@ -740,209 +794,179 @@
- + - 229 - 471 + 754 + 399 - package_sources + repository_stability_relations#ffffff id - BIGINT + MEDIUMINT True True - pkgbase - VARCHAR(64) + more_stable + MEDIUMINT True False - git_revision - VARCHAR(40) + less_stable + MEDIUMINT True False + +
+
+ + + 737 + 38 + + + statitstics + #ffffff + - mod_git_revision - VARCHAR(40) + id + BIGINT True - False + True - upsream_package_repository - SMALLINT + date + DATETIME True False - uses_upstream - BIT + stable_packages_count + MEDIUMINT True False - uses_modification - BIT + pending_tasks_count + MEDIUMINT True False - commit_time - DATETIME + staging_packages_count + MEDIUMINT True False - -
-
- - - 415 - 321 - - - architectures - #ffffff - - id - SMALLINT - True - True - - - name - VARCHAR(16) + testing_packages_count + MEDIUMINT True False - -
-
- - - 795 - 148 - - - install_targets - #ffffff - - id - BIGINT + broken_tasks_count + MEDIUMINT True - True + False - name - VARCHAR(64) + dependency_loops_count + MEDIUMINT True False - -
-
- - - 564 - 22 - - - dependencies - #ffffff - - id - BIGINT + dependency_looped_tasks_count + MEDIUMINT True - True + False - dependent - BIGINT + locked_tasks_count + MEDIUMINT True False - depending_on - BIGINT + blocked_tasks_count + MEDIUMINT True False - dependency_type - SMALLINT + next_tasks_count + MEDIUMINT True False
- + - 744 - 17 + 945 + -70 - dependency_types + todos#ffffff id - SMALLINT + BIGINT True True - name - VARCHAR(32) + file + VARCHAR(64) True False - relevant_for_building - BIT + line + MEDIUMINT True False - relevant_for_binary_packages - BIT + description + TEXT True False + + importance + SMALLINT + False + False +
- + - 52 - 516 + 788 + -60 - build_dependency_loops + todo_links#ffffff - id + dependent BIGINT True - True - - - loop - MEDIUMINT - True False - build_assignment + depending_on BIGINT True False @@ -950,18 +974,18 @@
- + - 763 - 241 + 258 + -44 - repository_stabilities + persons#ffffff id - SMALLINT + MEDIUMINT True True @@ -971,58 +995,46 @@ True False - - bugtracker_category - VARCHAR(32) - False - False -
- + - 481 - 395 + 106 + -51 - repository_moves + gpg_keys#ffffff id - MEDIUMINT + BIGINT True True - from_repository - MEDIUMINT + fingerprint + VARCHAR(40) True False - to_repository + owner MEDIUMINT True False - - upstream_package_repository - SMALLINT - True - False -
- + - -55 - -72 + 68 + 49 - mail_log + allowed_email_actions#ffffff @@ -1032,79 +1044,67 @@ True - date - DATETIME - True - False - - - success - BIT + gpg_key + BIGINT True False action - ENUM - False - False - - - count MEDIUMINT - False - False - - - gpg_key - BIGINT - False - False - - - comment - TEXT - False + True False
- + - 42 - 135 + -68 + 71 - ssh_log + email_actions#ffffff id - BIGINT + MEDIUMINT True True - date - DATETIME + name + VARCHAR(32) True False + +
+
+ + + 237 + 40 + + + ssh_keys + #ffffff + - build_slave - MEDIUMINT + id + BIGINT True - False + True - action - ENUM + owner + MEDIUMINT True False - parameters + fingerprint TEXT True False @@ -1112,24 +1112,24 @@
- + - 290.109 - 40 + 153.531 + 180.906 - 90 - + 0 + - 292.289 - 5.8125 - - 270 - + 186 + 196.906 + + 180 + @@ -1140,29 +1140,29 @@ Mandatory - 1 + 2 0 - + - 256.727 - 137 + 599.133 + 472.812 - 90 - + 270 + - 290.109 - 103.812 + 613.727 + 533 - 270 - + 90 + @@ -1173,29 +1173,29 @@ Mandatory - 2 + 3 0 - + - -9.85156 - 47.8125 + 559.755 + 395 - 270 - + 90 + - -20.2734 - 71 + 585.469 + 350.812 - 90 - + 270 + @@ -1206,29 +1206,29 @@ Mandatory - 3 + 1 0 - + - 68 - 80.9062 + 638.51 + 395 - 180 - + 90 + - 28.4531 - 95.9062 + 641.938 + 350.812 - 0 - + 270 + @@ -1244,24 +1244,24 @@ - + - 142.789 - 49 + 476.146 + 257.812 - 90 - + 270 + - 159.109 - 12.8125 + 462.273 + 321 - 270 - + 90 + @@ -1272,29 +1272,29 @@ Mandatory - 1 + 11 0 - + - 35.2969 - -12.0938 + 499.672 + -34.0625 0 - + - 106 - -19.0938 + 540 + -25.0938 180 - + @@ -1305,29 +1305,29 @@ Mandatory - 5 + 3 0 - + - 212.219 - -19.0938 + 698.406 + 311.906 0 - + - 257 - -19.0938 + 763 + 272.906 180 - + @@ -1343,24 +1343,24 @@ - + - 1101.23 - 271.604 + 499.672 + -8.125 0 - + - 1142 - 265.604 + 563 + 66.9062 180 - + @@ -1371,29 +1371,29 @@ Mandatory - 0 + 2 0 - + - 1101.23 - 288.208 + 631.109 + 131 - 0 - + 90 + - 1142 - 296.208 + 613.016 + 91.8125 - 180 - + 270 + @@ -1404,29 +1404,29 @@ Mandatory - 1 + 2 0 - + - 816.656 - 399 + 423.836 + 17.8125 - 90 - + 270 + - 815.635 - 304.812 + 450.859 + 54 - 270 - + 90 + @@ -1437,29 +1437,29 @@ Mandatory - 2 + 1 0 - + - 879.312 - 399 + 553 + 162.906 - 90 - + 180 + - 868.271 - 304.812 + 526.719 + 121.938 - 270 - + 0 + @@ -1475,24 +1475,24 @@ - + - 103.573 - 346 + 459.531 + 537.906 - 90 - + 0 + - 98.7188 - 321.812 + 539 + 564.906 - 270 - + 180 + @@ -1508,24 +1508,24 @@ - + - 204.719 - 398.906 + 526.719 + 189.875 0 - + - 247 - 350.906 + 613.703 + 273 - 180 - + 90 + @@ -1541,24 +1541,24 @@ - + - 154.146 - 346 + 688.453 + 564.906 - 90 - + 0 + - 233.151 - 256.812 + 770 + 553.906 - 270 - + 180 + @@ -1569,29 +1569,29 @@ Mandatory - 1 + 2 0 - + - 133.195 - 516 + 340.948 + 410.812 - 90 - + 270 + - 293.974 - 410.812 + 344.266 + 471 - 270 - + 90 + @@ -1602,29 +1602,29 @@ Mandatory - 2 + 1 0 - + - 280.302 - 256.812 + 387.922 + 350.906 - 270 - + 0 + - 293.974 - 291 + 415 + 345.906 - 90 - + 180 + @@ -1635,7 +1635,7 @@ Mandatory - 3 + 2 0 @@ -1673,24 +1673,24 @@ - + - 387.922 - 350.906 + 280.302 + 256.812 - 0 - + 270 + - 415 - 345.906 + 293.974 + 291 - 180 - + 90 + @@ -1701,29 +1701,29 @@ Mandatory - 2 + 3 0 - + - 340.948 - 410.812 + 133.195 + 516 - 270 - + 90 + - 344.266 - 471 + 293.974 + 410.812 - 90 - + 270 + @@ -1734,29 +1734,29 @@ Mandatory - 1 + 2 0 - + - 688.453 - 564.906 + 128.859 + 346 - 0 - + 90 + - 770 - 553.906 + 233.151 + 256.812 - 180 - + 270 + @@ -1767,29 +1767,29 @@ Mandatory - 2 + 1 0 - + - 526.719 - 206.859 + 204.719 + 398.906 0 - + - 613.703 - 273 + 247 + 350.906 - 90 - + 180 + @@ -1805,24 +1805,24 @@ - + - 459.531 - 537.906 + 53 + 398.906 - 0 - + 180 + - 539 - 564.906 + 33.4375 + 408.906 - 180 - + 0 + @@ -1838,24 +1838,24 @@ - + - 553 - 162.906 + 816.656 + 399 - 180 - + 90 + - 526.719 - 155.906 + 815.635 + 304.812 - 0 - + 270 + @@ -1871,24 +1871,24 @@ - + - 564 - 60.9062 + 879.312 + 399 - 180 - + 90 + - 526.719 - 104.953 + 868.271 + 304.812 - 0 - + 270 + @@ -1899,29 +1899,29 @@ Mandatory - 1 + 2 0 - + - 709.219 - 162.906 + 915.234 + -43.3958 0 - + - 795 - 172.906 + 945 + -39.3958 180 - + @@ -1932,29 +1932,29 @@ Mandatory - 2 + 1 0 - + - 639.836 - 99.8125 + 915.234 + -26.7917 - 270 - + 0 + - 845.016 - 148 + 945 + -8.79167 - 90 - + 180 + @@ -1965,29 +1965,29 @@ Mandatory - 2 + 0 0 - + - 698.406 - 311.906 + 212.219 + -19.0938 0 - + - 763 - 272.906 + 258 + -19.0938 180 - + @@ -2003,24 +2003,24 @@ - + - 715.672 - 60.9062 + 35.2969 + -12.0938 0 - + - 744 - 55.9062 + 106 + -19.0938 180 - + @@ -2031,29 +2031,29 @@ Mandatory - 3 + 5 0 - + - 476.146 - 257.812 + 142.789 + 49 - 270 - + 90 + - 462.273 - 321 + 159.109 + 12.8125 - 90 - + 270 + @@ -2064,29 +2064,29 @@ Mandatory - 11 + 1 0 - + - 559.755 - 395 + 68 + 80.9062 - 90 - + 180 + - 585.469 - 350.812 + 29.4531 + 95.9062 - 270 - + 0 + @@ -2102,24 +2102,24 @@ - + - 638.51 - 395 + -9.85156 + 47.8125 - 90 - + 270 + - 641.938 - 350.812 + -19.2734 + 71 - 270 - + 90 + @@ -2130,29 +2130,29 @@ Mandatory - 1 + 3 0 - + - 599.133 - 472.812 + 256.727 + 137 - 270 - + 90 + - 613.727 - 533 + 290.109 + 103.812 - 90 - + 270 + @@ -2163,29 +2163,29 @@ Mandatory - 3 + 2 0 - + - 153.531 - 180.906 + 290.109 + 40 - 0 - + 90 + - 186 - 196.906 + 293.289 + 5.8125 - 180 - + 270 + @@ -2196,7 +2196,7 @@ Mandatory - 2 + 1 0 diff --git a/misc/database-layout.dump b/misc/database-layout.dump new file mode 100644 index 0000000..64cb5fd --- /dev/null +++ b/misc/database-layout.dump @@ -0,0 +1,357 @@ +calculate_dependencies_of_package_upto_first_built_one NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `calculate_dependencies_of_package_upto_first_built_one`(IN `target_pkgbase` VARCHAR(64)) +BEGIN +INSERT IGNORE INTO `relevant_binary_packages` (`id`) SELECT `binary_packages`.`id` FROM `binary_packages` JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id` AND `repositories`.`name`="build-list" JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id` JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id` WHERE `package_sources`.`pkgbase`=`target_pkgbase`; +REPEAT +INSERT IGNORE INTO `relevant_binary_packages_copy` (`id`) SELECT `relevant_binary_packages`.`id` FROM `relevant_binary_packages`; +INSERT IGNORE INTO `relevant_binary_packages` (`id`) SELECT `install_target_providers`.`package` FROM `relevant_binary_packages_copy` JOIN `binary_packages` ON `relevant_binary_packages_copy`.`id`=`binary_packages`.`id` JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id` AND `repositories`.`name`="build-list" JOIN `dependencies` ON `binary_packages`.`id`=`dependencies`.`dependent` JOIN `dependency_types` ON `dependencies`.`dependency_type`=`dependency_types`.`id` AND `dependency_types`.`relevant_for_building` JOIN `install_target_providers` ON `dependencies`.`depending_on`=`install_target_providers`.`install_target`; +UNTIL ROW_COUNT()=0 +END REPEAT; +END utf8mb4 utf8mb4_unicode_ci utf8mb4_unicode_ci +calculate_maximal_moveable_set NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `calculate_maximal_moveable_set`(IN `from_stability` VARCHAR(32)) +BEGIN +DECLARE row_count_saved INT DEFAULT 0; +DROP TEMPORARY TABLE IF EXISTS `moveable_binary_packages`; +DROP TEMPORARY TABLE IF EXISTS `replaced_binary_packages`; +CREATE TEMPORARY TABLE `replaced_binary_packages` (`id` BIGINT, `replaced_by` BIGINT, UNIQUE KEY (`id`)); +CREATE TEMPORARY TABLE `moveable_binary_packages` (`id` BIGINT, `to_repository` MEDIUMINT, UNIQUE KEY (`id`)); +DROP TEMPORARY TABLE IF EXISTS `moveable_binary_packages_copy`; +DROP TEMPORARY TABLE IF EXISTS `replaced_binary_packages_copy`; +CREATE TEMPORARY TABLE `replaced_binary_packages_copy` (`id` BIGINT, `replaced_by` BIGINT, UNIQUE KEY (`id`)); +CREATE TEMPORARY TABLE `moveable_binary_packages_copy` (`id` BIGINT, `to_repository` MEDIUMINT, UNIQUE KEY (`id`)); +DROP TEMPORARY TABLE IF EXISTS `moveable_binary_packages_copy2`; +DROP TEMPORARY TABLE IF EXISTS `replaced_binary_packages_copy2`; +CREATE TEMPORARY TABLE `replaced_binary_packages_copy2` (`id` BIGINT, `replaced_by` BIGINT, UNIQUE KEY (`id`)); +INSERT IGNORE INTO `moveable_binary_packages` (`id`,`to_repository`) SELECT `binary_packages`.`id`,`repository_moves`.`to_repository` FROM `binary_packages` JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id` JOIN `repository_stabilities` ON `repositories`.`stability`=`repository_stabilities`.`id` JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id` JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id` JOIN `upstream_repositories` ON `package_sources`.`upstream_package_repository`=`upstream_repositories`.`id` JOIN `repository_moves` ON `upstream_repositories`.`id`=`repository_moves`.`upstream_package_repository` AND `repository_moves`.`from_repository`=`binary_packages`.`repository` WHERE `repository_stabilities`.`name` = `from_stability` AND (`from_stability`="staging" OR `binary_packages`.`is_tested`) AND NOT `binary_packages`.`has_issues`; +INSERT IGNORE INTO `replaced_binary_packages` (`id`,`replaced_by`) SELECT `r_bp`.`id`,`m_bp`.`id` FROM `moveable_binary_packages` JOIN `binary_packages` AS `m_bp` ON `m_bp`.`id`=`moveable_binary_packages`.`id` JOIN `repositories` AS `m_r` ON `m_bp`.`repository`=`m_r`.`id` JOIN `build_assignments` AS `m_ba` ON `m_bp`.`build_assignment`=`m_ba`.`id` JOIN `package_sources` AS `m_ps` ON `m_ba`.`package_source`=`m_ps`.`id` JOIN `upstream_repositories` AS `m_ur` ON `m_ps`.`upstream_package_repository`=`m_ur`.`id` JOIN `repository_moves` ON `m_ur`.`id`=`repository_moves`.`upstream_package_repository` AND `repository_moves`.`from_repository`=`m_r`.`id` JOIN `repositories` AS `r_r` ON `repository_moves`.`to_repository`=`r_r`.`id` JOIN `binary_packages` AS `r_bp` ON `r_r`.`id`=`r_bp`.`repository` AND `r_bp`.`pkgname`=`m_bp`.`pkgname`; +REPEAT +DELETE FROM `replaced_binary_packages_copy`; +INSERT IGNORE INTO `replaced_binary_packages_copy` SELECT `replaced_binary_packages`.* FROM `replaced_binary_packages`; +DELETE FROM `replaced_binary_packages_copy2`; +INSERT IGNORE INTO `replaced_binary_packages_copy2` SELECT `replaced_binary_packages`.* FROM `replaced_binary_packages`; +DELETE FROM `moveable_binary_packages_copy`; +INSERT IGNORE INTO `moveable_binary_packages_copy` SELECT `moveable_binary_packages`.* FROM `moveable_binary_packages`; +DELETE `replaced_binary_packages`,`moveable_binary_packages` FROM `replaced_binary_packages` RIGHT JOIN `moveable_binary_packages` ON `moveable_binary_packages`.`id`=`replaced_binary_packages`.`replaced_by` JOIN `binary_packages` ON `binary_packages`.`id`=`moveable_binary_packages`.`id` JOIN `repositories` AS `target_repositories` ON `moveable_binary_packages`.`to_repository`=`target_repositories`.`id` JOIN `dependencies` ON `binary_packages`.`id`=`dependencies`.`dependent` JOIN `dependency_types` ON `dependencies`.`dependency_type`=`dependency_types`.`id` AND `dependency_types`.`relevant_for_binary_packages` WHERE NOT EXISTS (SELECT * FROM `install_target_providers` JOIN `binary_packages` AS `prov_bp` ON `install_target_providers`.`package`=`prov_bp`.`id` JOIN `repositories` AS `prov_r` ON `prov_bp`.`repository`=`prov_r`.`id` JOIN `repository_stability_relations` ON `prov_r`.`stability`=`repository_stability_relations`.`more_stable` WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on` AND `target_repositories`.`stability`=`repository_stability_relations`.`less_stable` AND NOT EXISTS (SELECT * FROM `replaced_binary_packages_copy` WHERE `replaced_binary_packages_copy`.`id`=`prov_bp`.`id`)) AND NOT EXISTS (SELECT * FROM `install_target_providers` JOIN `moveable_binary_packages_copy` ON `moveable_binary_packages_copy`.`id`=`install_target_providers`.`package` WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on`); +SET @row_count_saved = ROW_COUNT(); +DELETE FROM `replaced_binary_packages_copy`; +INSERT IGNORE INTO `replaced_binary_packages_copy` SELECT `replaced_binary_packages`.* FROM `replaced_binary_packages`; +DELETE FROM `replaced_binary_packages_copy2`; +INSERT IGNORE INTO `replaced_binary_packages_copy2` SELECT `replaced_binary_packages`.* FROM `replaced_binary_packages`; +DELETE FROM `moveable_binary_packages_copy`; +INSERT IGNORE INTO `moveable_binary_packages_copy` SELECT `moveable_binary_packages`.* FROM `moveable_binary_packages`; +DELETE `replaced_binary_packages`,`moveable_binary_packages` FROM `replaced_binary_packages` JOIN `moveable_binary_packages` ON `replaced_binary_packages`.`replaced_by`=`moveable_binary_packages`.`id` JOIN `binary_packages` AS `repl_bp` ON `repl_bp`.`id`=`replaced_binary_packages`.`id` JOIN `install_target_providers` ON `repl_bp`.`id`=`install_target_providers`.`package` JOIN `dependencies` ON `install_target_providers`.`install_target`=`dependencies`.`depending_on` AND NOT EXISTS (SELECT * FROM `replaced_binary_packages_copy` WHERE `replaced_binary_packages_copy`.`id`=`dependencies`.`dependent`) JOIN `dependency_types` ON `dependencies`.`dependency_type`=`dependency_types`.`id` AND `dependency_types`.`relevant_for_binary_packages` JOIN `binary_packages` AS `req_bp` ON `dependencies`.`dependent`=`req_bp`.`id` JOIN `repositories` AS `repl_r` ON `repl_bp`.`repository`=`repl_r`.`id` JOIN `repositories` AS `req_r` ON `req_bp`.`repository`=`req_r`.`id` JOIN `repository_stability_relations` AS `repl_rr` ON `repl_rr`.`more_stable`=`repl_r`.`stability` AND `repl_rr`.`less_stable`=`req_r`.`stability` WHERE NOT EXISTS (SELECT * FROM `moveable_binary_packages_copy` JOIN `install_target_providers` AS `subst_itp` ON `moveable_binary_packages_copy`.`id`=`subst_itp`.`package` WHERE `subst_itp`.`install_target`=`install_target_providers`.`install_target`) AND NOT EXISTS (SELECT * FROM `binary_packages` AS `subst_bp` JOIN `install_target_providers` AS `subst_itp` ON `subst_bp`.`id`=`subst_itp`.`package` JOIN `repositories` AS `subst_r` ON `subst_bp`.`repository`=`subst_r`.`id` JOIN `repository_stability_relations` AS `subst_rr` ON `subst_rr`.`more_stable`=`subst_r`.`stability` WHERE `subst_rr`.`less_stable`=`repl_r`.`stability` AND NOT EXISTS (SELECT * FROM `replaced_binary_packages_copy2` WHERE `replaced_binary_packages_copy2`.`id`=`subst_bp`.`id`) AND `subst_itp`.`install_target`=`install_target_providers`.`install_target`); +UNTIL row_count_saved=0 AND ROW_COUNT()=0 +END REPEAT; +DROP TEMPORARY TABLE `moveable_binary_packages_copy`; +DROP TEMPORARY TABLE `replaced_binary_packages_copy`; +DROP TEMPORARY TABLE `replaced_binary_packages_copy2`; +END utf8mb4 utf8mb4_unicode_ci utf8mb4_unicode_ci +show_broken_packages_and_dependencies NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `show_broken_packages_and_dependencies`() +BEGIN +CREATE TEMPORARY TABLE `broken_packages_and_dependencies` (`id` BIGINT, UNIQUE KEY (`id`)); +CREATE TEMPORARY TABLE `broken_packages_and_dependencies_old` (`id` BIGINT, UNIQUE KEY (`id`)); +INSERT IGNORE INTO `broken_packages_and_dependencies` (`id`) SELECT `build_assignments`.`id` FROM `binary_packages` JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id` AND `build_assignments`.`is_broken` JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id` AND `repositories`.`name`="build-list"; +REPEAT +INSERT IGNORE INTO `broken_packages_and_dependencies_old` (`id`) SELECT `broken_packages_and_dependencies`.`id` FROM `broken_packages_and_dependencies`; +INSERT IGNORE INTO `broken_packages_and_dependencies` (`id`) SELECT `new_bp`.`build_assignment` FROM `broken_packages_and_dependencies_old` JOIN `binary_packages` AS `old_bp` ON `broken_packages_and_dependencies_old`.`id`=`old_bp`.`build_assignment` JOIN `dependencies` ON `old_bp`.`id`=`dependencies`.`dependent` JOIN `dependency_types` ON `dependencies`.`dependency_type`=`dependency_types`.`id` AND `dependency_types`.`relevant_for_building` JOIN `install_target_providers` ON `dependencies`.`depending_on`=`install_target_providers`.`install_target` JOIN `binary_packages` AS `new_bp` ON `install_target_providers`.`package`=`new_bp`.`id` JOIN `repositories` AS `new_repo` ON `new_bp`.`repository`=`new_repo`.`id` AND `new_repo`.`name` IN ("build-list","deletion-list"); +UNTIL ROW_COUNT()=0 +END REPEAT; +SELECT `package_sources`.`pkgbase`,`package_sources`.`git_revision`,`package_sources`.`mod_git_revision`,`upstream_repositories`.`name` FROM `build_assignments` JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id` JOIN `upstream_repositories` ON `package_sources`.`upstream_package_repository`=`upstream_repositories`.`id` JOIN `broken_packages_and_dependencies` ON `broken_packages_and_dependencies`.`id`=`build_assignments`.`id`; +END utf8mb4 utf8mb4_unicode_ci utf8mb4_unicode_ci +allowed_email_actions CREATE TABLE `allowed_email_actions` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `gpg_key` bigint(20) NOT NULL, + `action` mediumint(9) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`gpg_key`,`action`), + KEY `action` (`action`), + CONSTRAINT `allowed_email_actions_ibfk_1` FOREIGN KEY (`action`) REFERENCES `email_actions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `allowed_email_actions_ibfk_2` FOREIGN KEY (`gpg_key`) REFERENCES `gpg_keys` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +architectures CREATE TABLE `architectures` ( + `id` smallint(6) NOT NULL AUTO_INCREMENT, + `name` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +binary_packages CREATE TABLE `binary_packages` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `build_assignment` bigint(20) NOT NULL, + `repository` mediumint(9) NOT NULL, + `epoch` mediumint(9) NOT NULL, + `pkgver` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `pkgrel` mediumint(9) NOT NULL, + `sub_pkgrel` mediumint(9) NOT NULL, + `has_issues` bit(1) NOT NULL, + `is_tested` bit(1) NOT NULL, + `pkgname` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `architecture` smallint(6) NOT NULL, + `is_to_be_deleted` bit(1) NOT NULL, + `sha512sum` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `file_name` (`pkgname`,`epoch`,`pkgver`,`pkgrel`,`sub_pkgrel`,`architecture`,`repository`), + UNIQUE KEY `content` (`build_assignment`,`sub_pkgrel`,`pkgname`,`architecture`,`repository`), + KEY `repository` (`repository`), + KEY `architecture` (`architecture`), + CONSTRAINT `binary_packages_ibfk_1` FOREIGN KEY (`repository`) REFERENCES `repositories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `binary_packages_ibfk_2` FOREIGN KEY (`architecture`) REFERENCES `architectures` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `binary_packages_ibfk_3` FOREIGN KEY (`build_assignment`) REFERENCES `build_assignments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +build_assignments CREATE TABLE `build_assignments` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `package_source` bigint(20) NOT NULL, + `architecture` smallint(6) NOT NULL, + `is_blocked` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `is_broken` bit(1) NOT NULL, + `priority` smallint(6) NOT NULL, + `is_black_listed` text COLLATE utf8mb4_unicode_ci, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`package_source`,`architecture`), + KEY `architecture` (`architecture`), + CONSTRAINT `build_assignments_ibfk_1` FOREIGN KEY (`package_source`) REFERENCES `package_sources` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `build_assignments_ibfk_2` FOREIGN KEY (`architecture`) REFERENCES `architectures` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +build_dependency_loops CREATE TABLE `build_dependency_loops` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `loop` mediumint(9) NOT NULL, + `build_assignment` bigint(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`loop`,`build_assignment`), + KEY `build_assignment` (`build_assignment`), + CONSTRAINT `build_dependency_loops_ibfk_1` FOREIGN KEY (`build_assignment`) REFERENCES `build_assignments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +build_slaves CREATE TABLE `build_slaves` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `currently_building` bigint(20) DEFAULT NULL, + `last_connection` datetime NOT NULL, + `logged_lines` bigint(20) DEFAULT NULL, + `last_action` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `ssh_key` bigint(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `currently_building` (`currently_building`), + KEY `ssh_key` (`ssh_key`), + CONSTRAINT `build_slaves_ibfk_1` FOREIGN KEY (`currently_building`) REFERENCES `build_assignments` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `build_slaves_ibfk_2` FOREIGN KEY (`ssh_key`) REFERENCES `ssh_keys` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +dependencies CREATE TABLE `dependencies` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `dependent` bigint(20) NOT NULL, + `depending_on` bigint(20) NOT NULL, + `dependency_type` smallint(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`dependent`,`depending_on`,`dependency_type`), + KEY `depending_on` (`depending_on`), + KEY `dependency_type` (`dependency_type`), + CONSTRAINT `dependencies_ibfk_1` FOREIGN KEY (`dependent`) REFERENCES `binary_packages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dependencies_ibfk_2` FOREIGN KEY (`depending_on`) REFERENCES `install_targets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dependencies_ibfk_3` FOREIGN KEY (`dependency_type`) REFERENCES `dependency_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +dependency_types CREATE TABLE `dependency_types` ( + `id` smallint(6) NOT NULL AUTO_INCREMENT, + `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `relevant_for_building` bit(1) NOT NULL, + `relevant_for_binary_packages` bit(1) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +email_actions CREATE TABLE `email_actions` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +email_log CREATE TABLE `email_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL, + `success` bit(1) NOT NULL, + `action` mediumint(9) DEFAULT NULL, + `count` mediumint(9) DEFAULT NULL, + `gpg_key` bigint(20) DEFAULT NULL, + `comment` text COLLATE utf8mb4_unicode_ci, + PRIMARY KEY (`id`), + KEY `action` (`action`), + KEY `gpg_key` (`gpg_key`), + CONSTRAINT `email_log_ibfk_1` FOREIGN KEY (`action`) REFERENCES `email_actions` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `email_log_ibfk_2` FOREIGN KEY (`gpg_key`) REFERENCES `gpg_keys` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +fail_reasons CREATE TABLE `fail_reasons` ( + `id` smallint(6) NOT NULL AUTO_INCREMENT, + `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `identifier` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `severity` smallint(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +failed_builds CREATE TABLE `failed_builds` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `build_slave` mediumint(9) NOT NULL, + `build_assignment` bigint(20) NOT NULL, + `date` datetime NOT NULL, + `reason` smallint(6) NOT NULL, + `log_file` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `build_slave` (`build_slave`), + KEY `build_assignment` (`build_assignment`), + KEY `reason` (`reason`), + CONSTRAINT `failed_builds_ibfk_1` FOREIGN KEY (`build_slave`) REFERENCES `build_slaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `failed_builds_ibfk_2` FOREIGN KEY (`build_assignment`) REFERENCES `build_assignments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `failed_builds_ibfk_3` FOREIGN KEY (`reason`) REFERENCES `fail_reasons` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +git_repositories CREATE TABLE `git_repositories` ( + `id` smallint(6) NOT NULL AUTO_INCREMENT, + `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `url` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, + `directory` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, + `head` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + UNIQUE KEY `url` (`url`), + UNIQUE KEY `directory` (`directory`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +gpg_keys CREATE TABLE `gpg_keys` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `owner` mediumint(9) NOT NULL, + `fingerprint` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `fingerprint` (`fingerprint`), + KEY `owner` (`owner`), + CONSTRAINT `gpg_keys_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `persons` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +install_target_providers CREATE TABLE `install_target_providers` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `package` bigint(20) NOT NULL, + `install_target` bigint(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`package`,`install_target`), + KEY `install_target` (`install_target`), + CONSTRAINT `install_target_providers_ibfk_1` FOREIGN KEY (`package`) REFERENCES `binary_packages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `install_target_providers_ibfk_2` FOREIGN KEY (`install_target`) REFERENCES `install_targets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +install_targets CREATE TABLE `install_targets` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +package_sources CREATE TABLE `package_sources` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `pkgbase` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `git_revision` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, + `mod_git_revision` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, + `upstream_package_repository` smallint(6) NOT NULL, + `uses_upstream` bit(1) NOT NULL, + `uses_modification` bit(1) NOT NULL, + `commit_time` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`pkgbase`,`git_revision`,`mod_git_revision`), + KEY `upstream_package_repository` (`upstream_package_repository`), + CONSTRAINT `package_sources_ibfk_1` FOREIGN KEY (`upstream_package_repository`) REFERENCES `upstream_repositories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +persons CREATE TABLE `persons` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +repositories CREATE TABLE `repositories` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `stability` mediumint(9) NOT NULL, + `is_on_master_mirror` bit(1) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `stability` (`stability`), + CONSTRAINT `repositories_ibfk_1` FOREIGN KEY (`stability`) REFERENCES `repository_stabilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +repository_moves CREATE TABLE `repository_moves` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `from_repository` mediumint(9) NOT NULL, + `to_repository` mediumint(9) NOT NULL, + `upstream_package_repository` smallint(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `source` (`from_repository`,`upstream_package_repository`), + KEY `to_repository` (`to_repository`), + KEY `upstream_package_repository` (`upstream_package_repository`), + CONSTRAINT `repository_moves_ibfk_1` FOREIGN KEY (`from_repository`) REFERENCES `repositories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `repository_moves_ibfk_2` FOREIGN KEY (`to_repository`) REFERENCES `repositories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `repository_moves_ibfk_3` FOREIGN KEY (`upstream_package_repository`) REFERENCES `upstream_repositories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +repository_stabilities CREATE TABLE `repository_stabilities` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `bugtracker_category` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +repository_stability_relations CREATE TABLE `repository_stability_relations` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `more_stable` mediumint(9) NOT NULL, + `less_stable` mediumint(9) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`more_stable`,`less_stable`), + KEY `less_stable` (`less_stable`), + CONSTRAINT `repository_stability_relations_ibfk_1` FOREIGN KEY (`more_stable`) REFERENCES `repository_stabilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `repository_stability_relations_ibfk_2` FOREIGN KEY (`less_stable`) REFERENCES `repository_stabilities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ssh_keys CREATE TABLE `ssh_keys` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `owner` mediumint(9) NOT NULL, + `fingerprint` text COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `owner` (`owner`), + CONSTRAINT `ssh_keys_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `persons` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +ssh_log CREATE TABLE `ssh_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL, + `build_slave` mediumint(9) DEFAULT NULL, + `action` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `parameters` text COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `build_slave` (`build_slave`), + CONSTRAINT `ssh_log_ibfk_1` FOREIGN KEY (`build_slave`) REFERENCES `build_slaves` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +statistics CREATE TABLE `statistics` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL, + `stable_packages_count` mediumint(9) NOT NULL, + `pending_tasks_count` mediumint(9) NOT NULL, + `pending_packages_count` mediumint(9) NOT NULL, + `staging_packages_count` mediumint(9) NOT NULL, + `testing_packages_count` mediumint(9) NOT NULL, + `tested_packages_count` mediumint(9) NOT NULL, + `broken_tasks_count` mediumint(9) NOT NULL, + `dependency_loops_count` mediumint(9) NOT NULL, + `dependency_looped_tasks_count` mediumint(9) NOT NULL, + `locked_tasks_count` mediumint(9) NOT NULL, + `blocked_tasks_count` mediumint(9) NOT NULL, + `next_tasks_count` mediumint(9) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `date` (`date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +todo_links CREATE TABLE `todo_links` ( + `dependent` bigint(20) NOT NULL, + `depending_on` bigint(20) NOT NULL, + UNIQUE KEY `content` (`dependent`,`depending_on`), + KEY `depending_on` (`depending_on`), + CONSTRAINT `todo_links_ibfk_1` FOREIGN KEY (`dependent`) REFERENCES `todos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `todo_links_ibfk_2` FOREIGN KEY (`depending_on`) REFERENCES `todos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +todos CREATE TABLE `todos` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `file` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `line` mediumint(9) NOT NULL, + `description` text COLLATE utf8mb4_unicode_ci NOT NULL, + `importance` smallint(6) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci +upstream_repositories CREATE TABLE `upstream_repositories` ( + `id` smallint(6) NOT NULL AUTO_INCREMENT, + `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, + `git_repository` smallint(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content` (`name`,`git_repository`), + KEY `git_repository` (`git_repository`), + CONSTRAINT `upstream_repositories_ibfk_1` FOREIGN KEY (`git_repository`) REFERENCES `git_repositories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci -- cgit v1.2.3-70-g09d2