Impact Table Implementation
Kevin Benton
kevin.benton at amd.com
Tue Jan 9 21:00:42 UTC 2007
Hi all,
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:
versions => {
FIELDS => [
value => {TYPE => 'varchar(64)', NOTNULL => 1},
product_id => {TYPE => 'INT2', NOTNULL => 1},
component_id => {TYPE => 'INT2', NOTNULL => 0},
],
INDEXES => [
versions_product_id_idx => {FIELDS => [qw(product_id value)],
TYPE => 'UNIQUE'},
versions_component_id_idx => {FIELDS => [qw(product_id
component_id
value)],
TYPE => 'UNIQUE'},
],
},
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.
Next, I am creating impacts and impact_map tables:
impacts => {
FIELDS => [
impact_id => {TYPE => 'MEDIUMSERIAL',
NOTNULL => 1,
PRIMARYKEY => 1},
product_id => {TYPE => 'INT2', NOTNULL => 1},
component_id => {TYPE => 'INT2', NOTNULL => 0},
version => {TYPE => 'varchar(64)', NOTNULL => 1},
],
INDEXES => [
impactss_product_id_idx => {FIELDS => [qw(product_id
version)],
TYPE => 'UNIQUE'},
impactss_component_id_idx => {FIELDS => [qw(product_id
component_id
version)],
TYPE => 'UNIQUE'},
],
},
impact_map => {
FIELDS => [
impacting_id => {TYPE => 'INT3', NOTNULL => 1},
impacted_id => {TYPE => 'INT3', NOTNULL => 1},
],
INDEXES => {
impact_map_idx => {FIELDS => [qw(impacting_id impacted_id)],
TYPE => 'UNIQUE'},
],
}
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.
I'm also looking at possibly implementing this through Hooks, but wanted
to get feedback here first.
Kevin
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bugzilla.org/pipermail/developers/attachments/20070109/d158b6a8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AMDLogo.png
Type: image/png
Size: 1784 bytes
Desc: not available
URL: <http://lists.bugzilla.org/pipermail/developers/attachments/20070109/d158b6a8/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kevin.benton.vcf
Type: text/x-vcard
Size: 892 bytes
Desc: not available
URL: <http://lists.bugzilla.org/pipermail/developers/attachments/20070109/d158b6a8/attachment.vcf>
More information about the developers
mailing list