<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi all,<br>
<br>
I'm implementing an impact table where product/component/version A
impacts product/component/version B. As a result, we're auto-creating
a bug for B when a bug for A is created. My challenge is determining
how others think this should be implemented. I've already made these
changes to the versions table:<br>
<br>
</font><tt> versions => {<br>
FIELDS => [<br>
value => {TYPE => 'varchar(64)', NOTNULL
=> 1},<br>
product_id => {TYPE => 'INT2', NOTNULL => 1},<br>
component_id => {TYPE => 'INT2', NOTNULL => 0},<br>
],<br>
INDEXES => [<br>
versions_product_id_idx => {FIELDS =>
[qw(product_id value)],<br>
TYPE => 'UNIQUE'},<br>
versions_component_id_idx => {FIELDS => [qw(product_id<br>
component_id<br>
value)],<br>
TYPE => 'UNIQUE'},<br>
],<br>
},</tt><font face="Helvetica, Arial, sans-serif"><br>
<br>
Note the addition of the component_id and the allowance for it being
NULL. In other words, this allows for a no-impact change to the rest
of Bugzilla but allows me to specify versions at the component level.<br>
<br>
Next, I am creating impacts and impact_map tables:<br>
</font><tt><br>
impacts => {<br>
FIELDS => [<br>
impact_id => {TYPE => 'MEDIUMSERIAL',<br>
NOTNULL => 1,<br>
PRIMARYKEY => 1},<br>
product_id => {TYPE => 'INT2', NOTNULL => 1},<br>
component_id => {TYPE => 'INT2', NOTNULL => 0},<br>
version => {TYPE => 'varchar(64)', NOTNULL
=> 1},<br>
],<br>
INDEXES => [<br>
impactss_product_id_idx => {FIELDS =>
[qw(product_id version)],<br>
TYPE => 'UNIQUE'},<br>
impactss_component_id_idx => {FIELDS => [qw(product_id<br>
component_id<br>
version)],<br>
TYPE => 'UNIQUE'},<br>
],<br>
},<br>
<br>
impact_map => {<br>
FIELDS => [<br>
impacting_id => {TYPE => 'INT3', NOTNULL => 1},<br>
impacted_id => {TYPE => 'INT3', NOTNULL => 1},<br>
],<br>
INDEXES => {<br>
impact_map_idx => {FIELDS => [qw(impacting_id
impacted_id)],<br>
TYPE => 'UNIQUE'},<br>
],<br>
}<br>
</tt><font face="Helvetica, Arial, sans-serif"><br>
What do you think about these changes to Schema.pm? Do you see any
hidden gotcha's here? I know we're technically frozen for 3.0,
however, there's a business need to get this implemented here and I
wanted to make sure it wasn't going to break anything for 3.2.<br>
<br>
I'm also looking at possibly implementing this through Hooks, but
wanted to get feedback here first.<br>
<br>
Kevin<br>
<br>
</font>
<div class="moz-signature">-- <br>
<img src="cid:part1.07090801.01030201@amd.com" border="0"></div>
</body>
</html>