Bugzilla – Attachment 188594 Details for
Bug 40529
Update how hold groups work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40529: (QA follow-up): Add UNIQUE KEY entries to table definition
Bug-40529-QA-follow-up-Add-UNIQUE-KEY-entries-to-t.patch (text/plain), 4.32 KB, created by
Pedro Amorim
on 2025-10-29 19:26:23 UTC
(
hide
)
Description:
Bug 40529: (QA follow-up): Add UNIQUE KEY entries to table definition
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-29 19:26:23 UTC
Size:
4.32 KB
patch
obsolete
>From 89fb8305c676aa6c91aaeddd3bfa17d436d0cc28 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 29 Oct 2025 17:56:49 +0000 >Subject: [PATCH] Bug 40529: (QA follow-up): Add UNIQUE KEY entries to table > definition > >The UNIQUE KEY are required as a hold group 'might have' a target hold, not 'has many' target holds. >This update and the other things this patch updates in atomicupdate + kohastructure should fix the error thrown by command: >perl /kohadevbox/misc4dev/run_tests.pl --instance=kohadev --db-password=password --run-db-compare-only --compare-with=HEAD > >But they don't, the error still complains: >ERROR - DB structures are not identical > >Even thought the produced table from atomicupdate and table on kohastructure are exactly the same, line for line. >--- > .../bug_40529_-_hold_group_table_target.pl | 10 ++++++---- > installer/data/mysql/kohastructure.sql | 12 +++++++----- > 2 files changed, 13 insertions(+), 9 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_40529_-_hold_group_table_target.pl b/installer/data/mysql/atomicupdate/bug_40529_-_hold_group_table_target.pl >index bff6bd7504b..d6d44d1cf44 100755 >--- a/installer/data/mysql/atomicupdate/bug_40529_-_hold_group_table_target.pl >+++ b/installer/data/mysql/atomicupdate/bug_40529_-_hold_group_table_target.pl >@@ -11,10 +11,12 @@ return { > unless ( TableExists('hold_group_target_holds') ) { > $dbh->do( > q{ >- CREATE TABLE hold_group_target_holds ( >- `hold_group_id` int unsigned NOT NULL UNIQUE COMMENT 'foreign key, linking this to the hold_groups table', >- `reserve_id` int(11) DEFAULT NULL UNIQUE COMMENT 'foreign key, linking this to the reserves table', >- PRIMARY KEY (`hold_group_id`, `reserve_id`), >+ CREATE TABLE `hold_group_target_holds` ( >+ `hold_group_id` int(10) unsigned NOT NULL COMMENT 'foreign key, linking this to the hold_groups table', >+ `reserve_id` int(11) NOT NULL COMMENT 'foreign key, linking this to the reserves table', >+ PRIMARY KEY (`hold_group_id`,`reserve_id`), >+ UNIQUE KEY `uq_hold_group_target_holds_hold_group_id` (`hold_group_id`), >+ UNIQUE KEY `uq_hold_group_target_holds_reserve_id` (`reserve_id`), > CONSTRAINT `hold_group_target_holds_ibfk_1` FOREIGN KEY (`hold_group_id`) REFERENCES `hold_groups` (`hold_group_id`) ON DELETE CASCADE, > CONSTRAINT `hold_group_target_holds_ibfk_2` FOREIGN KEY (`reserve_id`) REFERENCES `reserves` (`reserve_id`) ON DELETE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 56def5468e2..70952cbd2ca 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -5118,11 +5118,13 @@ CREATE TABLE `old_issues` ( > -- > DROP TABLE IF EXISTS `hold_group_target_holds`; > /*!40101 SET @saved_cs_client = @@character_set_client */; >-/*!40101 SET character_set_client = utf8 */; >-CREATE TABLE hold_group_target_holds ( >- `hold_group_id` int unsigned NOT NULL UNIQUE COMMENT 'foreign key, linking this to the hold_groups table', >- `reserve_id` int(11) DEFAULT NULL UNIQUE COMMENT 'foreign key, linking this to the reserves table', >- PRIMARY KEY (`hold_group_id`, `reserve_id`), >+/*!40101 SET character_set_client = utf8mb4 */; >+CREATE TABLE `hold_group_target_holds` ( >+ `hold_group_id` int(10) unsigned NOT NULL COMMENT 'foreign key, linking this to the hold_groups table', >+ `reserve_id` int(11) NOT NULL COMMENT 'foreign key, linking this to the reserves table', >+ PRIMARY KEY (`hold_group_id`,`reserve_id`), >+ UNIQUE KEY `uq_hold_group_target_holds_hold_group_id` (`hold_group_id`), >+ UNIQUE KEY `uq_hold_group_target_holds_reserve_id` (`reserve_id`), > CONSTRAINT `hold_group_target_holds_ibfk_1` FOREIGN KEY (`hold_group_id`) REFERENCES `hold_groups` (`hold_group_id`) ON DELETE CASCADE, > CONSTRAINT `hold_group_target_holds_ibfk_2` FOREIGN KEY (`reserve_id`) REFERENCES `reserves` (`reserve_id`) ON DELETE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40529
:
184868
|
184869
|
184870
|
184871
|
184872
|
185137
|
185138
|
185139
|
185140
|
185141
|
185210
|
185211
|
185212
|
185213
|
185214
|
185215
|
185303
|
185304
|
185305
|
185306
|
185307
|
186793
|
186794
|
186795
|
186796
|
186797
|
186798
|
186803
|
186804
|
186825
|
186826
|
186827
|
186828
|
186829
|
186830
|
186831
|
186832
|
188348
|
188349
|
188350
|
188351
|
188352
|
188353
|
188354
|
188355
|
188356
|
188594
|
188595
|
188933
|
188934