Open Bug 109473 (bz-references) Opened 23 years ago Updated 11 years ago

Constrain referential integrity as applicable (foreign keys)

Categories

(Bugzilla :: Database, enhancement, P3)

2.10
enhancement

Tracking

()

People

(Reporter: CodeMachine, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

(Keywords: helpwanted)

Attachments

(2 files)

We should make it so we can set up referential integrity constraints for
databases that support it.  Set up appropriate dependencies here.
Depends on: 106589, 109474
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.20
Blocks: 194355
Bugzilla 2.20 feature set is now frozen as of 15 Sept 2004.  Anything flagged
enhancement that hasn't already landed is being pushed out.  If this bug is
otherwise ready to land, we'll handle it on a case-by-case basis, please set the
blocking2.20 flag to '?' if you think it qualifies.
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
No longer blocks: 194355
Depends on: 194355
Depends on: bz-dbschema
Reassigning bugs that I'm not actively working on to the default component owner
in order to try to make some sanity out of my personal buglist.  This doesn't
mean the bug isn't being dealt with, just that I'm not the one doing it.  If you
are dealing with this bug, please assign it to yourself.
Assignee: justdave → general
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: Bugzilla 2.22 → ---
Someone should specify where in bugzilla referential integrity would be a significant constraint.

Setting helpwanted and improving (IMHO) the bug summary.
Keywords: helpwanted
Summary: Referential integrity. → Constrain referential integrity as applicable
Assignee: general → remi_zara
I'm actually going to take this, if you don't mind, Remi.
Assignee: remi_zara → mkanat
Component: Bugzilla-General → Database
Alias: bz-references
Depends on: 347439
Bah... it will move faster if you take it...
By the way, reading your patch for bug 347439, I have code to sort the tables in an order suitable for creation, if you want...
you might also mark bug 346241 as a blocker of this one.
(In reply to comment #5)
> By the way, reading your patch for bug 347439, I have code to sort the tables
> in an order suitable for creation, if you want...

  Sure, you could either post the patch or send me a copy. I basically have the beginning of code like that, in bug 347439 anyhow, right?
Depends on: 346241
This patch sorts the schema tables so that referenced tables are before referencing tables. Thus they are in an order suitable for creation in the DB.
It uses a topological sort algorithm, and does not require to manually tell which table should be before which other.
Depends on: 373442
Summary: Constrain referential integrity as applicable → Constrain referential integrity as applicable (foreign keys)
Added missing foreign key constraints (foreign keys information is based on http://www.ravenbrook.com/project/p4dti/tool/cgi/bugzilla-schema/index.cgi?action=single&version=3.0&view=View+schema#table-attachments) into Bugzilla/DB/Schema.pm file.  Please see attached patch.
Added missing foreign key constraints in Bugzilla/DB/Schema.pm file
Attachment #299069 - Flags: review?(mkanat)
Comment on attachment 299069 [details] [diff] [review]
Update Bugzilla/DB/Schema.pm file to include missing foreign key constraints

Dude. Please read the following page:

http://wiki.mozilla.org/Bugzilla:Simple_Patches

This needs to be split up into lots of small patches attached to individual bugs that block this one. This is a meta bug, there shouldn't be any patches here. Every time you make one of these changes, we have to test Bugzilla to make sure that all our INSERT and UPDATE statements are in the right order, everywhere. This requires review incrementally, not in one huge patch.
Attachment #299069 - Flags: review?(mkanat) → review-
Depends on: 414779
Depends on: 419782
Depends on: 422037
Depends on: 423363
Depends on: 423369
Depends on: 423372
Depends on: 423593
Depends on: 423598
Depends on: 426688
Depends on: 427445
Depends on: 427449
Depends on: 427452
Depends on: 427455
Depends on: 427461
Depends on: 427471
Depends on: 427477
Depends on: 427478
Depends on: 429804
Depends on: 462066
Depends on: 462068
Depends on: 462070
Depends on: 462072
Depends on: 462073
Blocks: 519043
I think this bug is mostly done, isn't it? Based on the *current* DB schema, all possible FKs have been added.
(In reply to comment #12)
> I think this bug is mostly done, isn't it? Based on the *current* DB schema,
> all possible FKs have been added.

  Yeah, unless we want to add a lot of text FKs to the bugs table for the single-select values. That's the only reason this bug is still open.
Assignee: mkanat → database
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: