Bugzilla – Attachment 153257 Details for
Bug 6796
Overnight checkouts taking into account opening and closing hours
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6796: Fix atomic updates
Bug-6796-Fix-atomic-updates.patch (text/plain), 5.49 KB, created by
Aleisha Amohia
on 2023-07-10 04:30:03 UTC
(
hide
)
Description:
Bug 6796: Fix atomic updates
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2023-07-10 04:30:03 UTC
Size:
5.49 KB
patch
obsolete
>From bc22bf71d8ebba387f25e93eb6f23c998fce83d4 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Sun, 30 Apr 2023 22:47:31 +0000 >Subject: [PATCH] Bug 6796: Fix atomic updates > >--- > ...nsiderLibraryHoursWhenIssuing_syspref.perl | 5 ---- > ...ConsiderLibraryHoursWhenIssuing_syspref.pl | 14 +++++++++ > .../bug_6796_-_add_branch_hours_table.perl | 20 ------------- > .../bug_6796_-_add_branch_hours_table.pl | 30 +++++++++++++++++++ > 4 files changed, 44 insertions(+), 25 deletions(-) > delete mode 100644 installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.perl > create mode 100644 installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl > delete mode 100644 installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.perl > create mode 100644 installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.perl b/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.perl >deleted file mode 100644 >index 927ae33178e..00000000000 >--- a/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.perl >+++ /dev/null >@@ -1,5 +0,0 @@ >-$DBversion = 'XXX'; >-if ( CheckVersion( $DBversion ) ) { >- $dbh->do(q{ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'ConsiderLibraryHoursWhenIssuing', 'ignore', 'close|open|ignore', "Take library opening hours into consideration to calculate due date when issuing.", 'Choice' ) }); >- NewVersion( $DBversion, 6796, "Add ConsiderLibraryHoursWhenIssuing system preference" ); >-} >diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl b/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl >new file mode 100644 >index 00000000000..2c230febeb3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl >@@ -0,0 +1,14 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "6796", >+ description => "Overnight checkouts taking into account opening and closing hours", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'ConsiderLibraryHoursWhenIssuing', 'ignore', 'close|open|ignore', "Take library opening hours into consideration to calculate due date when issuing.", 'Choice' ) }); >+ >+ say $out "Added system preference 'ConsiderLibraryHoursWhenIssuing'"; >+ }, >+}; >diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.perl b/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.perl >deleted file mode 100644 >index 964da04c610..00000000000 >--- a/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.perl >+++ /dev/null >@@ -1,20 +0,0 @@ >-$DBversion = 'XXX'; >-if ( CheckVersion( $DBversion ) ) { >- $dbh->do(q{ DROP TABLE IF EXISTS branch_hours }); >- $dbh->do(q{ >- CREATE TABLE branch_hours ( >- branchcode varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, >- day int(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 0, >- open_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, >- close_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, >- PRIMARY KEY (branchcode, day), >- CONSTRAINT branch_hours_ibfk_1 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE >- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >- }); >- >- my @indexes = (0..6); >- for my $i (@indexes) { >- $dbh->do(q{ INSERT INTO branch_hours (branchcode, day) SELECT branchcode, ? FROM branches }, undef, $i); >- } >- NewVersion( $DBversion, 6796, "Add branch_hours table" ); >-} >diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl b/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl >new file mode 100644 >index 00000000000..e33503257c6 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl >@@ -0,0 +1,30 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "6796", >+ description => "Overnight checkouts taking into account opening and closing hours", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ unless( TableExists('branch_hours') ) { >+ $dbh->do(q{ >+ CREATE TABLE branch_hours ( >+ branchcode varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, >+ day int(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 0, >+ open_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, >+ close_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, >+ PRIMARY KEY (branchcode, day), >+ CONSTRAINT branch_hours_ibfk_1 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ >+ my @indexes = (0..6); >+ for my $i (@indexes) { >+ $dbh->do(q{ INSERT INTO branch_hours (branchcode, day) SELECT branchcode, ? FROM branches }, undef, $i); >+ } >+ >+ say $out "Added table `branch_hours`"; >+ } >+ }, >+}; >-- >2.30.2
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 6796
:
124669
|
124670
|
124671
|
124672
|
134323
|
134324
|
134325
|
134326
|
134327
|
145669
|
145670
|
145671
|
145672
|
145673
|
146988
|
146989
|
146990
|
146991
|
146992
|
150442
|
150443
|
150444
|
150445
|
150446
|
150447
|
150448
|
150477
|
150478
|
153252
|
153253
|
153254
|
153255
|
153256
|
153257
|
153258
|
153259
|
153260
|
153261
|
153271
|
153272
|
153273
|
153274
|
153275
|
153276
|
153277
|
153278
|
153279
|
153280
|
156772
|
156773
|
156774
|
156775
|
156776
|
156777
|
156778
|
156779
|
156780
|
161970
|
161971
|
161972
|
161973
|
161974
|
161975
|
161976
|
161977
|
161978
|
161979
|
161980
|
161986
|
161987
|
161988
|
161989
|
162043
|
162044
|
162045
|
162046
|
162047
|
162048
|
162049
|
162050
|
162051
|
162052
|
162053
|
162054
|
162055
|
162056
|
162090
|
162091
|
162092
|
162093
|
162094
|
162095
|
162096
|
162097
|
162098
|
162099
|
162100
|
162101
|
162102
|
162103
|
162104
|
164511
|
164512
|
164513
|
164514
|
164515
|
164516
|
164517
|
164518
|
164538
|
164539
|
164540
|
164541
|
164542
|
164543
|
164544
|
164545
|
164546
|
164547
|
164548
|
164549
|
164550
|
164551
|
164552