From 9e7bb62bb58ca3a50e35fa8b814ce16b6973ab18 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 27 Mar 2018 09:22:45 +0200 Subject: bin/return-assignment: remove duplicate files from table instead of failing --- bin/return-assignment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/return-assignment b/bin/return-assignment index 6af8c84..6447dce 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -470,7 +470,7 @@ trigger_mirror_refreshs printf 'UPDATE `pkg_files`' printf ' SET `pkg_files`.`name_hash`=sha2(`pkg_files`.`name`,512),' printf ' `pkg_files`.`absolute_name_hash`=sha2(concat(`pkg_files`.`path`,`pkg_files`.`name`),512);\n' - printf 'ALTER TABLE `pkg_files` ADD UNIQUE INDEX `absolute_name_hash` (`absolute_name_hash`);\n' + printf 'ALTER IGNORE TABLE `pkg_files` ADD UNIQUE INDEX `absolute_name_hash` (`absolute_name_hash`);\n' printf 'INSERT IGNORE INTO `files` (`path`,`name`,`name_hash`,`absolute_name_hash`)' printf ' SELECT ' printf '`pkg_files`.`%s`,' \ -- cgit v1.2.3-70-g09d2