summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-12 10:03:31 +0200
committerErich Eckner <git@eckner.net>2018-06-12 10:03:31 +0200
commit60d6a7cc8c7e231a873d6cfa9bab0586ae3e6208 (patch)
tree4127865cbf717c4726f9afb1fb0e0cc7e1a8b914 /misc
parent8129f03985c196f7413a648bee59fe4ee549a2f6 (diff)
downloadbuilder-60d6a7cc8c7e231a873d6cfa9bab0586ae3e6208.tar.xz
misc/database-layout.dump: A "replaced" package may also be in a different repository.
Diffstat (limited to 'misc')
-rw-r--r--misc/database-layout.dump26
1 files changed, 15 insertions, 11 deletions
diff --git a/misc/database-layout.dump b/misc/database-layout.dump
index 29c4334..46f4814 100644
--- a/misc/database-layout.dump
+++ b/misc/database-layout.dump
@@ -99,22 +99,26 @@ INSERT IGNORE INTO `replaced_bpir` (`id`,`replaced_by`)
ON `m_bpir`.`package`=`m_bp`.`id`
JOIN `repositories` AS `m_from_r`
ON `m_bpir`.`repository`=`m_from_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_from_r`.`id`
JOIN `repositories` AS `m_to_r`
- ON `repository_moves`.`to_repository`=`m_to_r`.`id`
+ ON `moveable_bpir`.`to_repository`=`m_to_r`.`id`
+ JOIN `repository_stability_relations` AS `rsr_a`
+ ON `rsr_a`.`less_stable`=`m_to_r`.`stability`
JOIN `repositories` AS `r_r`
- ON `r_r`.`stability`=`m_to_r`.`stability`
+ ON `rsr_a`.`more_stable`=`r_r`.`stability` AND `r_r`.`architecture`=`m_to_r`.`architecture`
JOIN `binary_packages_in_repositories` AS `r_bpir`
ON `r_r`.`id`=`r_bpir`.`repository`
JOIN `binary_packages` AS `r_bp`
- ON `r_bpir`.`package`=`r_bp`.`id` AND `r_bp`.`pkgname`=`m_bp`.`pkgname`;
+ ON `r_bpir`.`package`=`r_bp`.`id` AND `r_bp`.`pkgname`=`m_bp`.`pkgname`
+ WHERE NOT EXISTS (
+SELECT 1
+ FROM `binary_packages_in_repositories` AS `sup_bpir`
+ JOIN `binary_packages` AS `sup_bp`
+ ON `sup_bpir`.`package`=`sup_bp`.`id`
+ JOIN `repositories` AS `sup_r`
+ ON `sup_bp`.`repository`=`sup_r`.`id`
+ JOIN `repository_stability_relations` AS `rsr_b`
+ ON `rsr_b`.`less_stable`=`sup_r`.`stability`
+ WHERE `sup_bp`.`pkgname`=`m_bp`.`pkgname` AND `sup_r`.`architecture`=`m_to_r`.`architecture` AND `rsr_b`.`more_stable`=`r_r`.`stability`);
REPEAT
SET row_count_saved = 0;
DELETE