]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1461492/1522341 - Schema changes for Regressions & Bug Type fields
authorKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 20 Feb 2019 16:42:33 +0000 (11:42 -0500)
committerDylan William Hardison <dylan@hardison.net>
Wed, 20 Feb 2019 16:42:33 +0000 (11:42 -0500)
Bugzilla/DB/Schema.pm
Bugzilla/Install/DB.pm

index ee96220cf661b10ded3958a97e40d7b1c4454fdb..7304f7c6612e4977ca4154d47d205285b8eaee64 100644 (file)
@@ -246,6 +246,7 @@ use constant ABSTRACT_SCHEMA => {
       bug_file_loc => {TYPE => 'MEDIUMTEXT',   NOTNULL => 1, DEFAULT => "''"},
       bug_severity => {TYPE => 'varchar(64)',  NOTNULL => 1},
       bug_status   => {TYPE => 'varchar(64)',  NOTNULL => 1},
+      bug_type     => {TYPE => 'varchar(20)'},
       creation_ts  => {TYPE => 'DATETIME'},
       delta_ts     => {TYPE => 'DATETIME',     NOTNULL => 1},
       short_desc   => {TYPE => 'varchar(255)', NOTNULL => 1},
@@ -289,6 +290,7 @@ use constant ABSTRACT_SCHEMA => {
       bugs_delta_ts_idx         => ['delta_ts'],
       bugs_bug_severity_idx     => ['bug_severity'],
       bugs_bug_status_idx       => ['bug_status'],
+      bugs_but_type_idx         => ['bug_type'],
       bugs_op_sys_idx           => ['op_sys'],
       bugs_priority_idx         => ['priority'],
       bugs_product_id_idx       => ['product_id'],
@@ -484,6 +486,26 @@ use constant ABSTRACT_SCHEMA => {
     ],
   },
 
+  regressions => {
+    FIELDS => [
+      regressed_by => {
+        TYPE       => 'INT3',
+        NOTNULL    => 1,
+        REFERENCES => {TABLE => 'bugs', COLUMN => 'bug_id', DELETE => 'CASCADE'}
+      },
+      regresses => {
+        TYPE       => 'INT3',
+        NOTNULL    => 1,
+        REFERENCES => {TABLE => 'bugs', COLUMN => 'bug_id', DELETE => 'CASCADE'}
+      },
+    ],
+    INDEXES => [
+      regressions_regresses_idx =>
+        {FIELDS => [qw(regresses regressed_by)], TYPE => 'UNIQUE'},
+      regressions_regressed_by_idx => ['regressed_by'],
+    ],
+  },
+
   attachments => {
     FIELDS => [
       attach_id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1},
@@ -812,6 +834,15 @@ use constant ABSTRACT_SCHEMA => {
   # Global Field Values
   # -------------------
 
+  bug_type => {
+    FIELDS  => dclone(FIELD_TABLE_SCHEMA->{FIELDS}),
+    INDEXES => [
+      bug_type_value_idx               => {FIELDS => ['value'], TYPE => 'UNIQUE'},
+      bug_type_sortkey_idx             => ['sortkey',           'value'],
+      bug_type_visibility_value_id_idx => ['visibility_value_id'],
+    ],
+  },
+
   bug_status => {
     FIELDS => [
       @{dclone(FIELD_TABLE_SCHEMA->{FIELDS})},
@@ -1419,6 +1450,7 @@ use constant ABSTRACT_SCHEMA => {
         TYPE       => 'INT3',
         REFERENCES => {TABLE => 'profiles', COLUMN => 'userid', DELETE => 'SET NULL'}
       },
+      default_bug_type  => {TYPE => 'varchar(20)'},
     ],
     INDEXES => [
       components_product_id_idx =>
index f9142fa4a124c1bac5a55b79b80cd327de3b6eb4..216e47bd327ae108f28ec6d9456d031aff005970 100644 (file)
@@ -780,6 +780,11 @@ sub update_table_definitions {
   $dbh->bz_add_column('products', 'bug_description_template',
     {TYPE => 'MEDIUMTEXT'});
 
+  # Bug 1522341 - kohei.yoshino@gmail.com
+  $dbh->bz_add_column('bugs', 'bug_type', {TYPE => 'varchar(20)'});
+  $dbh->bz_add_column('components', 'default_bug_type',
+    {TYPE => 'varchar(20)'});
+
   _add_oauth2_jwt_support();
 
   ################################################################