Bugzilla – Attachment 185631 Details for
Bug 38924
Introduce an organization level loan 'Quota' system for Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38924: Add patron_quotas table
Bug-38924-Add-patronquotas-table.patch (text/plain), 4.17 KB, created by
Victor Grousset/tuxayo
on 2025-08-21 17:24:49 UTC
(
hide
)
Description:
Bug 38924: Add patron_quotas table
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2025-08-21 17:24:49 UTC
Size:
4.17 KB
patch
obsolete
>From 47958edf76de4909f4466e050b41cc0e6bf8985e Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <jacobomara901@gmail.com> >Date: Wed, 15 Jan 2025 14:53:57 +0000 >Subject: [PATCH] Bug 38924: Add patron_quotas table > >Add the new patron_quotas table for storing circulation quotas >--- > .../atomicupdate/bug_38924-patron_quotas.pl | 33 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 22 +++++++++++++ > 2 files changed, 55 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl b/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl >new file mode 100755 >index 0000000000..848fe85c66 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl >@@ -0,0 +1,33 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "38924", >+ description => "Add patron quota table", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ unless ( TableExists('patron_quota') ) { >+ $dbh->do( >+ q{ >+ CREATE TABLE `patron_quota` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier for the quota record', >+ `description` longtext NOT NULL COMMENT 'user friendly description for the quota record', >+ `patron_id` int(11) NOT NULL COMMENT 'foreign key linking to borrowers.borrowernumber', >+ `allocation` int(11) NOT NULL DEFAULT 0 COMMENT 'total quota allocation for the period', >+ `used` int(11) NOT NULL DEFAULT 0 COMMENT 'amount of allocation used for current period', >+ `start_date` date NOT NULL COMMENT 'start date of the allocation period', >+ `end_date` date NOT NULL COMMENT 'end date of the allocation period', >+ PRIMARY KEY (`id`), >+ KEY `patron_quota_ibfk_1` (`patron_id`), >+ CONSTRAINT `patron_quota_ibfk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ } >+ ); >+ say_success( $out, "Patron quota table created successfully" ); >+ } else { >+ say_info( $out, "Patron quota table already exists" ); >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 2ad9c12b00..25bf2f85fd 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -6792,6 +6792,28 @@ CREATE TABLE `zebraqueue` ( > /*!40101 SET character_set_client = @saved_cs_client */; > /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; > >+-- >+-- Table structure for table `patron_quota` >+-- >+ >+DROP TABLE IF EXISTS `patron_quota`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `patron_quota` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier for the quota record', >+ `description` longtext NOT NULL COMMENT 'user friendly description for the quota record', >+ `patron_id` int(11) NOT NULL COMMENT 'foreign key linking to borrowers.borrowernumber', >+ `allocation` int(11) NOT NULL DEFAULT 0 COMMENT 'total quota allocation for the period', >+ `used` int(11) NOT NULL DEFAULT 0 COMMENT 'amount of allocation used for current period', >+ `start_date` date NOT NULL COMMENT 'start date of the allocation period', >+ `end_date` date NOT NULL COMMENT 'end date of the allocation period', >+ PRIMARY KEY (`id`), >+ KEY `patron_quota_ibfk_1` (`patron_id`), >+ CONSTRAINT `patron_quota_ibfk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+/*!40101 SET character_set_client = @saved_cs_client */; >+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; >+ > /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; > /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; > /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; >-- >2.50.1
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 38924
:
178582
|
178583
|
178584
|
178585
|
178586
|
178587
|
178588
|
178589
|
178590
|
178591
|
178592
|
178593
|
178594
|
178595
|
178596
|
178597
|
178598
|
178599
|
178600
|
178601
|
178602
|
178603
|
178604
|
178605
|
178606
|
178607
|
178608
|
185631
|
185632
|
185633
|
185634
|
185635
|
185636
|
185637
|
185638
|
185639
|
185640
|
185641
|
185642
|
185643
|
185644
|
185645
|
185646
|
185647
|
185648
|
185649
|
185650
|
185651
|
185652
|
185653
|
185654
|
185655
|
185656
|
185657
|
185675
|
185676
|
185677
|
185678
|
185679
|
185680
|
185681
|
185682
|
185683
|
185684
|
185685
|
185686
|
185687
|
185688
|
185689
|
185690
|
185691
|
185692
|
185693
|
185694
|
185695
|
185696
|
185697
|
185698
|
185699
|
185700
|
185701
|
185702