From cef841b0d826d0f8d8d2e282dc4e0d2da8ac85a3 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Tue, 22 Jun 2010 02:58:32 +0000 Subject: [PATCH] Bug 573454: Make the products.description field be NOT NULL in the database r=timello, a=mkanat git-svn-id: svn://10.0.0.236/trunk@260510 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm | 2 +- mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index c893632449d..b388df2f806 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7229 \ No newline at end of file +7230 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm index c354c1bebd9..9fc50788501 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm @@ -1217,7 +1217,7 @@ use constant ABSTRACT_SCHEMA => { REFERENCES => {TABLE => 'classifications', COLUMN => 'id', DELETE => 'CASCADE'}}, - description => {TYPE => 'MEDIUMTEXT'}, + description => {TYPE => 'MEDIUMTEXT', NOTNULL => 1}, isactive => {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 1}, defaultmilestone => {TYPE => 'varchar(20)', diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm index 7599199ab6a..069096800ec 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm @@ -616,10 +616,14 @@ sub update_table_definitions { $dbh->bz_alter_column('group_control_map', 'othercontrol', {TYPE => 'INT1', NOTNULL => 1, DEFAULT => CONTROLMAPNA}); + # Add NOT NULL to some columns that need it, and DEFAULT to + # attachments.ispatch. $dbh->bz_alter_column('attachments', 'ispatch', { TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'}); $dbh->bz_alter_column('keyworddefs', 'description', { TYPE => 'MEDIUMTEXT', NOTNULL => 1 }, ''); + $dbh->bz_alter_column('products', 'description', + { TYPE => 'MEDIUMTEXT', NOTNULL => 1 }, ''); ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point #