Bugzilla – Attachment 176844 Details for
Bug 28528
bulkmarcimport delete option doesn't delete biblio_metadata
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28528: bulkmarcimport delete option doesn't delete biblio_metadata
Bug-28528-bulkmarcimport-delete-option-doesnt-dele.patch (text/plain), 2.18 KB, created by
Roman Dolny
on 2025-01-20 20:36:53 UTC
(
hide
)
Description:
Bug 28528: bulkmarcimport delete option doesn't delete biblio_metadata
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-01-20 20:36:53 UTC
Size:
2.18 KB
patch
obsolete
>From b5d52f021e3e9b8a9b6f88175f8be916b7c033f9 Mon Sep 17 00:00:00 2001 >From: Roman Dolny <roman.dolny@jezuici.pl> >Date: Mon, 20 Jan 2025 19:18:37 +0000 >Subject: [PATCH] Bug 28528: bulkmarcimport delete option doesn't delete > biblio_metadata > >When using bulkmarcimport with the -d switch should not only delete >biblio, biblioitems and items, but also biblio_metadata. > >I haven't checked if a FK takes care of the data, but if it does, >we should still also reset the AUTO_INCREMENT:... > >Test plan: >========== >1. Check (and notice) the number of records in the biblio (bCount) and > biblio_metadata (bmCount) tables. Check the AUTO_INCREMENT value > for these tables (bAI, bmAI). >2. Import bibliographic records with delete, turn off foreign key checks > and non-existent filename: > misc/migration_tools/bulkmarcimport.pl -b -d -fk -file=non-exist-file >==> "Could not open..." is OK, file doesn't exist. >3. Repeat p. 1 and compare with previously noticed: > bCount => 0 (OK) > bmCount => unchanged (NOT OK) > bAI => 1 (OK) > bmAI => unchanged (NOT OK) >4. Apply the patch. >5. Repeat p. 2-3: > bCount => 0 (OK) > bmCount => 0 (changed, OK) > bAI => 1 (OK) > bmAI => 1 (changed, OK) > >Sponsored-by: Ignatianum University in Cracow >--- > misc/migration_tools/bulkmarcimport.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 70721f0529..0249997ebe 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -234,6 +234,8 @@ if ($delete) { > $dbh->do("ALTER TABLE biblioitems AUTO_INCREMENT = 1"); > $dbh->do("DELETE FROM items"); > $dbh->do("ALTER TABLE items AUTO_INCREMENT = 1"); >+ $dbh->do("DELETE FROM biblio_metadata"); >+ $dbh->do("ALTER TABLE biblio_metadata AUTO_INCREMENT = 1"); > } else { > print "Deleting authorities\n"; > $dbh->do("truncate auth_header"); >@@ -940,7 +942,7 @@ I<UNIMARC> are supported. MARC21 by default. > =item B<-d, --delete> > > Delete EVERYTHING related to biblio in koha-DB before import. Tables: biblio, >-biblioitems, items >+biblioitems, items, biblio_metadata > > =item B<-m>=I<FORMAT> > >-- >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 28528
: 176844