Bug 13624 - Remove columns branchcode, categorytype from table overduerules_transport...
authorBlou <philippe.blouin@inlibro.com>
Tue, 21 Apr 2015 17:54:45 +0000 (13:54 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Thu, 31 Dec 2015 12:47:16 +0000 (12:47 +0000)
commit7628c4a8540091f577c26211b4174c843a976126
tree743580da75b856f67d1f33b077cb0b898353898a
parent085beb209ad1b2025902f95d4b5586dc1f7a703a
Bug 13624 - Remove columns branchcode, categorytype from table overduerules_transport_types

This patch is a _requirement_ to Bug #12771, and will be necessary once we start managing more than 3 levels of overdue notice

TEST PLAN
1) Create or improve on overduerules data
  .1) Intranet -> tools -> overdue notices
  .2) Make sure to have data in first, second and third tabs
  .3) Make sure to have checked mixes of Email/Phone/Print/SMS (depending on availability)
  .4) Make sure to have different letters and delay on first/second/third tab for at least one category
  .5) Remember it all.
2) Apply patch
3) run installer/data/mysql/atomicupdate/update_13624_overduerules_transport_type.pl
4) run t/db_dependant/Overdues.t
5) Validate Overdue Notice page
  .1) validate data entered previously is still there
  .2) Add some more, save changes, validate

In installer/data/mysql/atomicupdate/update_13624_overduerules_transport_type.pl
    - A new column and primary key, 'overduerules_id', is added to the table 'overduerules'
    - A new column referencing a foreign key, 'overduerules_id', is added to the table 'overduerules_transport_types'
    - The columns 'branchcode' and 'categorytype' are removed from the table 'overduerules_transport_types'
    - Data is migrated from the old tables to the new ones

In installer/data/mysql/kohastructure.sql :
    - Table 'overduerules'
    - Added a primary key named 'overduerules_id'
    - Table 'overduerules_transport_types'
    - Added a foreign key named 'overduerules_id'
    - Dropped columns 'branchcode', 'categorycode' since we now have them referenced through 'overduerules_id'

In tools/overduerules.pl
    - INSERT and DELETE queries on 'overduerules_transport_types' were changed to reflect the new schema

In C4/Overdues.pm :
    - The SQL query of the function 'GetOverdueMessageTransportTypes' is changed to take into account the new design of 'overduerules_transport

In t/db_dependent/Overdues.t :
    - The INSERT calls before the tests were changed to take into account the new design of 'overduerules' and 'overduerules_transport_types'

Sponsored by : Halland County Library

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Persson <xarragon@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Overdues.pm
installer/data/mysql/atomicupdate/update_13624_overduerules_transport_type.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql
t/db_dependent/Overdues.t
tools/overduerules.pl