Bug 36755

Summary: Increase length of 'code' column in borrower_attribute_types
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: DatabaseAssignee: Pedro Amorim <pedro.amorim>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, kyle, m.de.rooy, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/899
Text to go in the release notes:
This extends the borrower_attribute_types.code field from varchar(10) to varchar(64). This makes it easier to use also for plugins who might want to use unique prefixes.
Version(s) released in:
24.05.00
Circulation function:
Attachments: Bug 36755: Update UI input element
Bug 36755: Atomicupdate file
Bug 36755: Atomicupdate file
Bug 36755: Update UI input element
Bug 36755: Atomicupdate file
Bug 36755: Update UI input element
Bug 36755: Atomicupdate file
Bug 36755: Update kohastructure.sql
Bug 36755: Update UI input element
Bug 36755: Atomicupdate file
Bug 36755: Update kohastructure.sql

Description Pedro Amorim 2024-05-02 12:40:30 UTC
Plugins may want to make use of patron attribute types thus prepending some data to the code of a patron attribute type they may need could be useful e.g. kitchensink_somefield.
Currently, the 'code' is limited to VARCHAR(10) so this not possible.
Comment 1 Pedro Amorim 2024-05-02 13:57:38 UTC
Created attachment 166070 [details] [review]
Bug 36755: Update UI input element
Comment 2 Pedro Amorim 2024-05-02 13:57:40 UTC
Created attachment 166071 [details] [review]
Bug 36755: Atomicupdate file

Test plan, k-t-d:
1) Apply patches.
2) Run the following SQL and save the output of each:
  SHOW CREATE TABLE pseudonymized_borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types_branches;
  SHOW CREATE TABLE borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types;
3) Run updatedatabase
4) Run the SQL queries again, compare the output of each with the previous output before updatedatabase.
5) Make sure the only diff between the two is VARCHAR(10) -> VARCHAR(64)
Comment 3 David Nind 2024-05-02 20:51:56 UTC Comment hidden (obsolete)
Comment 4 David Nind 2024-05-02 20:52:27 UTC
Created attachment 166087 [details] [review]
Bug 36755: Update UI input element

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2024-05-02 20:52:30 UTC
Created attachment 166088 [details] [review]
Bug 36755: Atomicupdate file

Test plan, k-t-d:
1) Apply patches.
2) Run the following SQL and save the output of each:
  SHOW CREATE TABLE pseudonymized_borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types_branches;
  SHOW CREATE TABLE borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types;
3) Run updatedatabase
4) Run the SQL queries again, compare the output of each with the previous output before updatedatabase.
5) Make sure the only diff between the two is VARCHAR(10) -> VARCHAR(64)

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Kyle M Hall (khall) 2024-05-07 16:37:04 UTC
Missing updates to kohastructure.sql
Comment 7 Kyle M Hall (khall) 2024-05-07 16:37:26 UTC
Created attachment 166309 [details] [review]
Bug 36755: Update UI input element

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Kyle M Hall (khall) 2024-05-07 16:37:32 UTC
Created attachment 166310 [details] [review]
Bug 36755: Atomicupdate file

Test plan, k-t-d:
1) Apply patches.
2) Run the following SQL and save the output of each:
  SHOW CREATE TABLE pseudonymized_borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types_branches;
  SHOW CREATE TABLE borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types;
3) Run updatedatabase
4) Run the SQL queries again, compare the output of each with the previous output before updatedatabase.
5) Make sure the only diff between the two is VARCHAR(10) -> VARCHAR(64)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall (khall) 2024-05-07 16:37:34 UTC
Created attachment 166311 [details] [review]
Bug 36755: Update kohastructure.sql

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Pedro Amorim 2024-05-07 17:29:19 UTC
(In reply to Kyle M Hall from comment #9)
> Created attachment 166311 [details] [review] [review]
> Bug 36755: Update kohastructure.sql
> 
> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Doh. Thanks! I got so enveloped in the rabbit hole of atomic update I forgot kohastructure.sql.

Although your follow-up seems to be missing the code column update on borrower_attribute_types!
Comment 11 Katrin Fischer 2024-05-07 18:26:56 UTC
(In reply to Pedro Amorim from comment #10)
> (In reply to Kyle M Hall from comment #9)
> > Created attachment 166311 [details] [review] [review] [review]
> > Bug 36755: Update kohastructure.sql
> > 
> > Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
> 
> Doh. Thanks! I got so enveloped in the rabbit hole of atomic update I forgot
> kohastructure.sql.
> 
> Although your follow-up seems to be missing the code column update on
> borrower_attribute_types!

Can you please add it?
Comment 12 Pedro Amorim 2024-05-08 08:23:47 UTC
Created attachment 166351 [details] [review]
Bug 36755: Update UI input element

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 13 Pedro Amorim 2024-05-08 08:23:50 UTC
Created attachment 166352 [details] [review]
Bug 36755: Atomicupdate file

Test plan, k-t-d:
1) Apply patches.
2) Run the following SQL and save the output of each:
  SHOW CREATE TABLE pseudonymized_borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types_branches;
  SHOW CREATE TABLE borrower_attributes;
  SHOW CREATE TABLE borrower_attribute_types;
3) Run updatedatabase
4) Run the SQL queries again, compare the output of each with the previous output before updatedatabase.
5) Make sure the only diff between the two is VARCHAR(10) -> VARCHAR(64)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 14 Pedro Amorim 2024-05-08 08:23:52 UTC
Created attachment 166353 [details] [review]
Bug 36755: Update kohastructure.sql

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

PA amended: Squashed borrower_attribute_types table update

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 15 Katrin Fischer 2024-05-08 16:25:20 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 16 Kyle M Hall (khall) 2024-05-08 16:52:30 UTC
(In reply to Pedro Amorim from comment #10)
> (In reply to Kyle M Hall from comment #9)
> > Created attachment 166311 [details] [review] [review] [review]
> > Bug 36755: Update kohastructure.sql
> > 
> > Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
> 
> Doh. Thanks! I got so enveloped in the rabbit hole of atomic update I forgot
> kohastructure.sql.
> 
> Although your follow-up seems to be missing the code column update on
> borrower_attribute_types!

Thanks Pedro!
Comment 17 Katrin Fischer 2024-05-10 14:02:29 UTC
Looks like I forgot the DBIC update, will push this to main now.
Comment 18 Fridolin Somers 2024-05-24 15:05:44 UTC
Not backported to 23.11.x