Closed Bug 462068 Opened 16 years ago Closed 16 years ago

Add FK constraints to the longdescs table

Categories

(Bugzilla :: Database, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: LpSolit, Assigned: vipinhegde)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

The bug_id and who columns in the longdescs table should point to bugs.bug_id and profiles.userid respectively.
Whiteboard: [Good Intro Bug]
I can work on this. Is there someone in particular I need to send an email to in order to get this ticket reassigned to me ? Cause I don't see the option to reassign this ticket to myself.
You can work on it even if not assigned to you. Anyway, the bug is now assigned to you.
Assignee: database → vipinhegde
Attached patch Patch.diff_V1 (obsolete) (deleted) — Splinter Review
I installed a fresh copy of bugzilla with my changes and verified that the install went through. Also checked the mysql database to verify that the new foreign keys were created successfully. I've sent an email to Mark to review the patch, since it is related to DB/Schema.pm. Should i hold off on marking the ticket as 'Fixed' until after the patch is approved ?
Attachment #362447 - Flags: review?(mkanat)
(In reply to comment #4) > Should i hold off on marking the ticket as 'Fixed' until after the patch is approved ? You will have to wait your patch to be reviewed+, eventually super-reviewed+ *and* checked into the code base (tree) before marking it as FIXED. After the patch has been checked into the tree, it has to be verified with the latest codebase to see if nothing is broken. Then, the bug can be marked as VERIFIED.
Status: NEW → ASSIGNED
Vipin, and by the way, don't send email to the people you want a review from: when you are asking "review?" to someone, Bugzilla automatically sends an email to that people.
Comment on attachment 362447 [details] [diff] [review] Patch.diff_V1 >+++ Bugzilla/DB/Schema.pm 15 Feb 2009 05:22:22 -0000 >@@ -375,8 +375,14 @@ > FIELDS => [>+ bug_id => {TYPE => 'INT3', NOTNULL => 1, >+ REFERENCES => {TABLE => 'bugs', We don't use tabs, we use spaces. >+ who => {TYPE => 'INT3', NOTNULL => 1, >+ REFERENCES => {TABLE => 'profiles', >+ COLUMN => 'userid', >+ DELETE => 'CASCADE'}}, I would say RESTRICT for this one. If you've added a comment, you can't be deleted, no? I'm not entirely sure though.
Attachment #362447 - Flags: review?(mkanat) → review-
I agree with your point on the "RESTRICT" check. I've modified the patch to remove tabs and replaced the CASCADE with the RESTRICT keyword. - Ran ./runtests . All tests passed. - Tried out use case by adding one more user to my local bugzilla. Used that new account to enter comments to a bug. After that, I logged in as Admin and tried to delete that user account. Got a valid error message indicating that the user has comments in the system and therefore, cannot be deleted. Will upload 2 files: 1) Patch.diff (V2) 2) Screenshot of bugzilla page which indicates that the user cannot be deleted because of pre-existing comments in the system.
Attached patch Patch.diff_V2 (deleted) — Splinter Review
Changelog for this version of the patch.diff file: 1) Replaced tabs with spaces 2) Replaced "CASCADE" with "RESTRICT" for "who" column
Attachment #362447 - Attachment is obsolete: true
Attachment #362494 - Flags: review?(mkanat)
Attached image Error screen (deleted) —
Screen shot showing error screen UI
We don't need the screenshot. The page being displayed is unrelated to your patch.
Attachment #362494 - Flags: review?(mkanat) → review+
Comment on attachment 362494 [details] [diff] [review] Patch.diff_V2 Looks good to me! :-)
Holding approval for whenever we branch.
Flags: approval?
Target Milestone: --- → Bugzilla 3.6
Whiteboard: [Good Intro Bug]
Flags: approval? → approval+
Checking in Bugzilla/DB/Schema.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v <-- Schema.pm new revision: 1.114; previous revision: 1.113 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Blocks: 486239
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: