Bugzilla – Attachment 133458 Details for
Bug 30565
Field stockrotationrotas.description should be NOT NULL, title UNIQUE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30565: Database revision for stockrotationrotas
Bug-30565-Database-revision-for-stockrotationrotas.patch (text/plain), 1.57 KB, created by
Marcel de Rooy
on 2022-04-20 11:40:32 UTC
(
hide
)
Description:
Bug 30565: Database revision for stockrotationrotas
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-04-20 11:40:32 UTC
Size:
1.57 KB
patch
obsolete
>From fe3527be730edaf6c04297220a8f8f977ea56584 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 20 Apr 2022 11:29:58 +0000 >Subject: [PATCH] Bug 30565: Database revision for stockrotationrotas >Content-Type: text/plain; charset=utf-8 > >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> >--- > .../data/mysql/atomicupdate/bug_30565.pl | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_30565.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_30565.pl b/installer/data/mysql/atomicupdate/bug_30565.pl >new file mode 100755 >index 0000000000..874a2a2a12 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30565.pl >@@ -0,0 +1,19 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => 30565, >+ description => "Update table stockrotationrotas", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ if( !unique_key_exists('stockrotationrotas', 'stockrotationrotas_title') ) { >+ $dbh->do( q| >+ALTER TABLE stockrotationrotas ADD CONSTRAINT UNIQUE KEY stockrotationrotas_title (title) >+ |); >+ } >+ # Make sure that description is NOT NULL >+ $dbh->do( q| >+ALTER TABLE stockrotationrotas MODIFY COLUMN description text NOT NULL COMMENT 'Description for this rota' >+ |); >+ }, >+}; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30565
:
133457
|
133458
|
133459
|
133766
|
133767
|
133768