Bug 30565

Summary: Field stockrotationrotas.description should be NOT NULL, title UNIQUE
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: DatabaseAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: kyle, martin.renvoize, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Martin Renvoize Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.06
Bug Depends on:    
Bug Blocks: 30486    
Attachments: Bug 30565: Correct kohastructure
Bug 30565: Database revision for stockrotationrotas
Bug 30565: DBIx schema change for stockrotationrotas
Bug 30565: Correct kohastructure
Bug 30565: Database revision for stockrotationrotas
Bug 30565: DBIx schema change for stockrotationrotas

Description Marcel de Rooy 2022-04-19 14:48:02 UTC

    
Comment 1 Marcel de Rooy 2022-04-19 14:48:54 UTC
Compare this

$DBversion = '18.06.00.040'; CONSTRAINT `stockrotationrotas_title` UNIQUE (`title`)  EN `title` varchar(100) NOT NULL,            -- Title for this rota
$DBversion = '18.06.00.048';     $dbh->do( "ALTER TABLE stockrotationrotas CHANGE COLUMN description description text" );  #Bug 21682

with kohastructure.sql.
Comment 2 Marcel de Rooy 2022-04-20 11:40:28 UTC
Created attachment 133457 [details] [review]
Bug 30565: Correct kohastructure

The unique key was added in a dbrev and is referred to in code.
But forgotten in kohastructure.

Test plan:
Run new install or kohastructure.sql on empty db.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2022-04-20 11:40:32 UTC
Created attachment 133458 [details] [review]
Bug 30565: Database revision for stockrotationrotas

Add unique key if needed.
Adjust description column to make it NOT NULL.

Test plan:
(Optionally:) Drop unique key, make description nullable.
Run dbrev.
Check if unique key present, and description not-nullable.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2022-04-20 11:40:37 UTC
Created attachment 133459 [details] [review]
Bug 30565: DBIx schema change for stockrotationrotas

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Tomás Cohen Arazi 2022-04-25 12:30:43 UTC
Created attachment 133766 [details] [review]
Bug 30565: Correct kohastructure

The unique key was added in a dbrev and is referred to in code.
But forgotten in kohastructure.

Test plan:
Run new install or kohastructure.sql on empty db.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi 2022-04-25 12:30:56 UTC
Created attachment 133767 [details] [review]
Bug 30565: Database revision for stockrotationrotas

Add unique key if needed.
Adjust description column to make it NOT NULL.

Test plan:
(Optionally:) Drop unique key, make description nullable.
Run dbrev.
Check if unique key present, and description not-nullable.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi 2022-04-25 12:31:09 UTC
Created attachment 133768 [details] [review]
Bug 30565: DBIx schema change for stockrotationrotas

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Tomás Cohen Arazi 2022-04-25 12:32:04 UTC
Trivial fix, straight QA for me.

Great work, Marcel!
Comment 9 Fridolin Somers 2022-05-02 21:25:30 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 10 Kyle M Hall 2022-05-06 17:55:00 UTC
Pushed to 21.11.x for 21.11.06
Comment 11 Victor Grousset/tuxayo 2022-06-22 23:34:24 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.
Comment 12 Martin Renvoize 2022-06-23 13:39:46 UTC
Architectural fix, no documentation changes required.