From 5d39a702303be0ba74cf80f08ccae96437e059e2 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Tue, 13 Oct 2020 08:58:21 +0000 Subject: [PATCH] Further 5.0->6.0 schema upgrade fixes --- Bugzilla/DB/Schema.pm | 2 +- Bugzilla/Install/DB.pm | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index e1c1629d61..4268796c42 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -658,7 +658,7 @@ use constant ABSTRACT_SCHEMA => { FIELDS => [ id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, type_id => { - TYPE => 'INT2', + TYPE => 'INT3', NOTNULL => 1, REFERENCES => {TABLE => 'flagtypes', COLUMN => 'id', DELETE => 'CASCADE'} }, diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index ff276cab85..32be6b9194 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -484,8 +484,15 @@ sub update_table_definitions { $dbh->bz_drop_column('groups', 'last_changed'); # 2006-08-06 LpSolit@gmail.com - Bug 347521 + $dbh->bz_drop_related_fks('flagtypes', 'id'); $dbh->bz_alter_column('flagtypes', 'id', {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); + $dbh->bz_alter_column('flags', 'type_id', + {TYPE => 'INT3', NOTNULL => 1}); + $dbh->bz_alter_column('flaginclusions', 'type_id', + {TYPE => 'INT3', NOTNULL => 1}); + $dbh->bz_alter_column('flagexclusions', 'type_id', + {TYPE => 'INT3', NOTNULL => 1}); $dbh->bz_alter_column('keyworddefs', 'id', {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1});