From: travis%sedsystems.ca <> Date: Fri, 25 Feb 2005 07:57:22 +0000 (+0000) Subject: Bug 277504 : quips migrated from quip file have an (invalid) userid of 0 X-Git-Tag: bugzilla-2.18.1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2f9251a28eb0b8fa523833424bffdc58aba8fda;p=thirdparty%2Fbugzilla.git Bug 277504 : quips migrated from quip file have an (invalid) userid of 0 Patch by Frederic Buclin r=mkanat a=myk --- diff --git a/checksetup.pl b/checksetup.pl index eb34ec6681..c0759d562d 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -1957,10 +1957,11 @@ $table{bug_group_map} = index(group_id)'; # 2002-07-19, davef@tetsubo.com, bug 67950: +# 2005-02-20, LpSolit@gmail.com, bug 277504 # Store quips in the db. $table{quips} = 'quipid mediumint not null auto_increment primary key, - userid mediumint not null default 0, + userid mediumint null, quip text not null, approved tinyint(1) not null default 1'; @@ -4093,6 +4094,16 @@ AddField('flags', 'is_active', 'tinyint not null default 1'); +# 2005-02-20 - LpSolit@gmail.com - Bug 277504 +# When migrating quips from the '$datadir/comments' file to the DB, +# the user ID should be NULL instead of 0 (which is an invalid user ID). +if (!GetFieldDef('quips', 'userid')->[2]) { + ChangeFieldType('quips', 'userid', 'mediumint null'); + print "Changing owner to NULL for quips where the owner is unknown...\n"; + $dbh->do('UPDATE quips SET userid = NULL WHERE userid = 0'); +} + + # If you had to change the --TABLE-- definition in any way, then add your # differential change code *** A B O V E *** this comment. #