Bugzilla – Attachment 66387 Details for
Bug 14826
Store account offsets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14826 - Update database
Bug-14826---Update-database.patch (text/plain), 3.56 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-08-23 16:04:12 UTC
(
hide
)
Description:
Bug 14826 - Update database
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-08-23 16:04:12 UTC
Size:
3.56 KB
patch
obsolete
>From 72a598516ce0fb8af775f56df25fb7051421255f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 12 Jul 2016 13:50:11 +0000 >Subject: [PATCH] Bug 14826 - Update database > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > installer/data/mysql/atomicupdate/bug_14826.sql | 12 ++++++++++++ > installer/data/mysql/kohastructure.sql | 21 ++++++++++++--------- > 2 files changed, 24 insertions(+), 9 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_14826.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_14826.sql b/installer/data/mysql/atomicupdate/bug_14826.sql >new file mode 100644 >index 0000000..91d183b >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14826.sql >@@ -0,0 +1,12 @@ >+DROP TABLE IF EXISTS `accountoffsets`; >+CREATE TABLE IF NOT EXISTS `account_offsets` ( >+ `id` int(11) NOT NULL auto_increment, -- unique identifier for each offset >+ `credit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline the increased the patron's balance >+ `debit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline that decreased the patron's balance >+ `type` varchar(16) NOT NULL, -- The type of offset this is >+ `amount` decimal(26,6) NOT NULL, -- The amount of the change >+ `created_on` timestamp NOT NULL default CURRENT_TIMESTAMP, >+ PRIMARY KEY (`id`), >+ CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e227125..e883ffb 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2732,17 +2732,20 @@ CREATE TABLE `accountlines` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; > > -- >--- Table structure for table `accountoffsets` >+-- Table structure for table `account_offsets` > -- > >-DROP TABLE IF EXISTS `accountoffsets`; >-CREATE TABLE `accountoffsets` ( >- `borrowernumber` int(11) NOT NULL default 0, >- `accountno` smallint(6) NOT NULL default 0, >- `offsetaccount` smallint(6) NOT NULL default 0, >- `offsetamount` decimal(28,6) default NULL, >- `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, >- CONSTRAINT `accountoffsets_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+DROP TABLE IF EXISTS `account_offsets`; >+CREATE TABLE `account_offsets` ( >+ `id` int(11) NOT NULL auto_increment, -- unique identifier for each offset >+ `credit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline the increased the patron's balance >+ `debit_id` int(11) NULL DEFAULT NULL, -- The id of the accountline that decreased the patron's balance >+ `type` varchar(16) NOT NULL, -- The type of offset this is >+ `amount` decimal(26,6) NOT NULL, -- The amount of the change >+ `created_on` timestamp NOT NULL default CURRENT_TIMESTAMP, >+ PRIMARY KEY (`id`), >+ CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; > > -- >-- >2.7.4
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 14826
:
53318
|
53319
|
53320
|
53321
|
53324
|
53326
|
53602
|
53603
|
53604
|
53605
|
53606
|
53607
|
59254
|
59255
|
59256
|
59257
|
59258
|
60270
|
60271
|
60272
|
60273
|
60274
|
60275
|
60276
|
60277
|
60278
|
60439
|
60440
|
60441
|
60442
|
60443
|
60444
|
60445
|
60446
|
64051
|
64052
|
64053
|
64054
|
64055
|
64056
|
64057
|
64058
|
64059
|
64217
|
64220
|
64222
|
64223
|
64224
|
64225
|
64226
|
64227
|
64228
|
65459
|
65460
|
65461
|
65462
|
65463
|
65464
|
65465
|
65466
|
65467
|
65642
|
65643
|
65644
|
65645
|
65646
|
65647
|
65648
|
65649
|
65650
|
65651
|
65652
|
66387
|
66388
|
66389
|
66390
|
66391
|
66392
|
66393
|
66394
|
66395
|
66396
|
66397
|
66716
|
67453
|
67454
|
67455
|
67456
|
67457
|
67458
|
67459
|
67460
|
67461
|
67462
|
67463
|
67464
|
67465
|
67936
|
67937
|
67938
|
67939
|
67940
|
67941
|
67942
|
67943
|
67944
|
67945
|
67946
|
67947
|
67948
|
67949
|
68018
|
68019
|
68020
|
68021
|
68022
|
68023
|
68024
|
68025
|
68026
|
68027
|
68028
|
68029
|
68030
|
68031
|
68032
|
68334
|
68383