Bug 30565 - Field stockrotationrotas.description should be NOT NULL, title UNIQUE
Summary: Field stockrotationrotas.description should be NOT NULL, title UNIQUE
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 30486
  Show dependency treegraph
 
Reported: 2022-04-19 14:48 UTC by Marcel de Rooy
Modified: 2022-06-23 13:39 UTC (History)
4 users (show)

See Also:
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


Attachments
Bug 30565: Correct kohastructure (1.33 KB, patch)
2022-04-20 11:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30565: Database revision for stockrotationrotas (1.57 KB, patch)
2022-04-20 11:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30565: DBIx schema change for stockrotationrotas (1.40 KB, patch)
2022-04-20 11:40 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30565: Correct kohastructure (1.35 KB, patch)
2022-04-25 12:30 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30565: Database revision for stockrotationrotas (1.59 KB, patch)
2022-04-25 12:30 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 30565: DBIx schema change for stockrotationrotas (1.42 KB, patch)
2022-04-25 12:31 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.