Bug 24722

Summary: reserves.priority must be NOT NULL
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: katrin.fischer, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24680
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Attachments: Bug 24722: Enforce NOT NULL constraint on reserves.priority
Bug 24722: Enforce NOT NULL constraint on reserves.priority
Bug 24722: Add test
Bug 24722: DBIC changes
Bug 24722: Enforce NOT NULL constraint on reserves.priority
Bug 24722: Add test
Bug 24722: DBIC changes
Bug 24722: Add atomicupdate file
Bug 24722: Enforce NOT NULL constraint on reserves.priority
Bug 24722: Add test
Bug 24722: DBIC changes
Bug 24722: Add atomicupdate file
Bug 24722: Same change for old_reserves.priority
Bug 24722: reserves.priority must default to 1 at DB level
Bug 24722: reserves.priority must default to 1 at DB level

Description Jonathan Druart 2020-02-25 11:05:10 UTC
`priority` smallint(6) default NULL
but it cannot be null
Comment 1 Jonathan Druart 2020-02-25 11:08:17 UTC
Created attachment 99572 [details] [review]
Bug 24722: Enforce NOT NULL constraint on reserves.priority

This field is never NULL and must always be equal to an integer.
Comment 2 Jonathan Druart 2020-02-25 11:23:22 UTC
Created attachment 99576 [details] [review]
Bug 24722: Enforce NOT NULL constraint on reserves.priority

This field is never NULL and must always be equal to an integer.
Comment 3 Jonathan Druart 2020-02-25 11:23:25 UTC
Created attachment 99577 [details] [review]
Bug 24722: Add test
Comment 4 Jonathan Druart 2020-02-25 11:26:46 UTC
Created attachment 99578 [details] [review]
Bug 24722: DBIC changes
Comment 5 Martin Renvoize 2020-02-25 16:47:31 UTC
Created attachment 99595 [details] [review]
Bug 24722: Enforce NOT NULL constraint on reserves.priority

This field is never NULL and must always be equal to an integer.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-02-25 16:47:34 UTC
Created attachment 99596 [details] [review]
Bug 24722: Add test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-02-25 16:47:37 UTC
Created attachment 99597 [details] [review]
Bug 24722: DBIC changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2020-02-25 16:49:44 UTC
Good call.. I should have raised that before pushing the bug that fixed the priority not being set for SIP transactions..

Signing off.
Comment 9 Jonathan Druart 2020-02-26 12:21:07 UTC
Created attachment 99642 [details] [review]
Bug 24722: Add atomicupdate file
Comment 10 Katrin Fischer 2020-03-16 21:25:11 UTC
This seems ok. Only wondering: should we be changing old_reserves as well? The table still has:
  `priority` smallint(6) default NULL, -- where in the queue the patron sits
Comment 11 Katrin Fischer 2020-03-16 21:25:53 UTC
Created attachment 100822 [details] [review]
Bug 24722: Enforce NOT NULL constraint on reserves.priority

This field is never NULL and must always be equal to an integer.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2020-03-16 21:25:56 UTC
Created attachment 100823 [details] [review]
Bug 24722: Add test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2020-03-16 21:26:00 UTC
Created attachment 100824 [details] [review]
Bug 24722: DBIC changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Katrin Fischer 2020-03-16 21:26:03 UTC
Created attachment 100825 [details] [review]
Bug 24722: Add atomicupdate file

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Jonathan Druart 2020-03-17 08:04:54 UTC
Created attachment 100860 [details] [review]
Bug 24722: Same change for old_reserves.priority
Comment 16 Jonathan Druart 2020-03-17 08:05:17 UTC
(In reply to Katrin Fischer from comment #10)
> This seems ok. Only wondering: should we be changing old_reserves as well?
> The table still has:
>   `priority` smallint(6) default NULL, -- where in the queue the patron sits

Yes of course, thanks!
Comment 17 Martin Renvoize 2020-03-18 08:40:30 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 18 Jonathan Druart 2020-03-18 10:09:04 UTC
Created attachment 100945 [details] [review]
Bug 24722: reserves.priority must default to 1 at DB level

https://bugs.koha-community.org/show_bug.cgi?id=22821
Comment 19 Jonathan Druart 2020-03-18 10:10:31 UTC
Created attachment 100946 [details] [review]
Bug 24722: reserves.priority must default to 1 at DB level