bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Add foreign key constraints for bugs_activity table

RESOLVED FIXED in Bugzilla 3.4

Status

()

Bugzilla
Database
--
enhancement
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: Tony Fu, Assigned: Tony Fu)

Tracking

(Blocks: 1 bug)

unspecified
Bugzilla 3.4
Dependency tree / graph
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070510 Fedora/1.5.0.10-6.fc6 Firefox/1.5.0.10
Build Identifier: 

Add foreign key information for bugs_activity table in Bugzilla/DB/Schema.pm file.

Reproducible: Didn't try
(Assignee)

Comment 1

11 years ago
I have added foreign key information for bugs_activity table in Bugzilla/DB/Schema.pm and want to submit the patch for review.
Blocks: 109473
(Assignee)

Comment 2

11 years ago
Created attachment 300296 [details] [diff] [review]
foreign key constraints information of bugs_activity table 

Hi Max,

Although I have added foreign key constraints for all tables, I am not sure what is the good way to submit them for reviewing.  I know the reviewer prefer small piece of patch, so I attached a patch which shows the foreign key information of bugs_activity table only.

If there are any other way I should do, please feel free to let me know.


Thanks,
Tony
Attachment #300296 - Flags: review?(mkanat)

Updated

11 years ago
Assignee: database → tfu
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

11 years ago
Comment on attachment 300296 [details] [diff] [review]
foreign key constraints information of bugs_activity table 

Yes, this looks generally fine, but did you test everything in Bugzilla to make sure that these fields are correctly populated? (That is, that INSERTs and UPDATEs happen in the right order.)

Comment 4

11 years ago
Comment on attachment 300296 [details] [diff] [review]
foreign key constraints information of bugs_activity table 

>+            attach_id => {TYPE => 'INT3',
>+                          REFERENCES    =>  {TABLE  =>  'attachments',
>+                                            COLUMN  =>  'attach_id'}},

  That should also be DELETE CASCADE.
Attachment #300296 - Flags: review?(mkanat) → review-
(Assignee)

Comment 5

11 years ago
(In reply to comment #3)
> (From update of attachment 300296 [details] [diff] [review])
> Yes, this looks generally fine, but did you test everything in Bugzilla to make
> sure that these fields are correctly populated? (That is, that INSERTs and
> UPDATEs happen in the right order.)
> 

I have tested them by adding and editing bugs and table updating happens in the right order.
(Assignee)

Comment 6

11 years ago
(In reply to comment #4)
> (From update of attachment 300296 [details] [diff] [review])
> >+            attach_id => {TYPE => 'INT3',
> >+                          REFERENCES    =>  {TABLE  =>  'attachments',
> >+                                            COLUMN  =>  'attach_id'}},
> 
>   That should also be DELETE CASCADE.
> 
Max,

Thank you very much for your review.

It seems that no Bugzilla UI operation (or xmlrpc) can cause an attachments.attach_id to be deleted, so I didn't put "DELETE CASCADE" for attach_id at previous patch.  But I think explicitly specify referential action
for attach_id could be a better thing to do, so I added "DELETE CASCADE" for attach_id.  Please see the new patch for details.

Thanks,
Tony


Thanks,
Tony
(Assignee)

Comment 7

11 years ago
Created attachment 302535 [details] [diff] [review]
foreign key constraints information of bugs_activity table
Attachment #300296 - Attachment is obsolete: true
Attachment #302535 - Flags: review?(mkanat)

Comment 8

11 years ago
Comment on attachment 302535 [details] [diff] [review]
foreign key constraints information of bugs_activity table

Yeah, this looks fine, then. Some spacing will have to be fixed on checkin.
Attachment #302535 - Flags: review?(mkanat) → review+

Updated

11 years ago
Severity: normal → enhancement
Status: NEW → ASSIGNED
Flags: approval+
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 4.0

Comment 9

11 years ago
Requires a branch for 3.2 before we can commit it. Do we want to delay checkins on the trunk till we have a larger number of patches ready?

Comment 10

11 years ago
(In reply to comment #9)
> Requires a branch for 3.2 before we can commit it. Do we want to delay checkins
> on the trunk till we have a larger number of patches ready?

  Sure, as long as they (like this one) don't block anything else.

Updated

10 years ago
Duplicate of this bug: 425647

Updated

10 years ago
Blocks: 425647

Updated

10 years ago
Blocks: 427936

Updated

10 years ago
No longer blocks: 427936

Comment 12

10 years ago
I checked in all of the pending FK patches at once:

Checking in Bugzilla/DB/Schema.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v  <--  Schema.pm
new revision: 1.100; previous revision: 1.99
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Updated

10 years ago
Target Milestone: Bugzilla 4.0 → Bugzilla 3.4
You need to log in before you can comment on or make changes to this bug.