Closed
Bug 505165
Opened 15 years ago
Closed 14 years ago
The flags.setter_id DB column cannot be NULL
Categories
(Bugzilla :: Database, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.0
People
(Reporter: LpSolit, Assigned: LpSolit)
Details
Attachments
(1 file, 1 obsolete file)
1.68 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
A flag always has a setter. The DB should enforce this (it already has a FK pointing to profiles.userid). NOTNULL => 1 is missing.
Comment 1•15 years ago
|
||
Isn't it NULL when there's only a requester and no responder?
Assignee | ||
Comment 2•15 years ago
|
||
No idea what a responder is. Do you mean requestee? A flag has two user fields, one setter/requester (flags.setter_id, which must always be set), and the requestee (flags.requestee_id).
Comment 3•15 years ago
|
||
By responder I mean the person who grants +/-. I thought that if you just requested a flag, then requester_id was set, but setter_id was not.
Assignee | ||
Comment 4•15 years ago
|
||
Max, I wrote: $dbh->bz_alter_column('flags', 'setter_id', {TYPE => 'INT3', NOTNULL => 1}); but Pg crashes with: Adding foreign key: flags.setter_id -> profiles.userid... DBD::Pg::db do failed: ERROR: constraint « fk_flags_setter_id_profiles_userid » for table « flags » already exists at Bugzilla/DB.pm line 515 Bugzilla::DB::bz_add_fk('Bugzilla::DB::Pg=HASH(0xa2e6130)', 'flags', 'setter_id', 'HASH(0xa342250)') called at Bugzilla/DB.pm line 450 Bugzilla::DB::bz_setup_foreign_keys('Bugzilla::DB::Pg=HASH(0xa2e6130)') called at Bugzilla/Install/DB.pm line 593 Bugzilla::Install::DB::update_table_definitions('HASH(0x8a847b0)') called at ./checksetup.pl line 192 at Bugzilla/DB.pm line 515 Bugzilla::DB::bz_add_fk('Bugzilla::DB::Pg=HASH(0xa2e6130)', 'flags', 'setter_id', 'HASH(0xa342250)') called at Bugzilla/DB.pm line 450 Bugzilla::DB::bz_setup_foreign_keys('Bugzilla::DB::Pg=HASH(0xa2e6130)') called at Bugzilla/Install/DB.pm line 593 Bugzilla::Install::DB::update_table_definitions('HASH(0x8a847b0)') called at ./checksetup.pl line 192 Why is checksetup.pl trying to add the FK again?
Comment 5•15 years ago
|
||
(In reply to comment #4) > Why is checksetup.pl trying to add the FK again? Hmm, dunnow--could be a bug. Does it still happen if you create a fresh database and then apply your patch and run checksetup again?
Assignee | ||
Updated•14 years ago
|
Target Milestone: --- → Bugzilla 3.8
Updated•14 years ago
|
Whiteboard: [Good Intro Bug]
Assignee | ||
Comment 6•14 years ago
|
||
OK, I cannot reproduce the error mentioned above. I was probably playing with a broken DB (due to another patch I was testing).
Assignee | ||
Comment 7•14 years ago
|
||
Oops, I missed one file.
Attachment #482076 -
Attachment is obsolete: true
Attachment #482077 -
Flags: review?(mkanat)
Attachment #482076 -
Flags: review?(mkanat)
Updated•14 years ago
|
Attachment #482077 -
Flags: review?(mkanat) → review+
Updated•14 years ago
|
Flags: approval4.0+
Flags: approval+
Assignee | ||
Comment 8•14 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/DB/Schema.pm modified Bugzilla/Install/DB.pm Committed revision 7532. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/ modified Bugzilla/DB/Schema.pm modified Bugzilla/Install/DB.pm Committed revision 7435.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [Good Intro Bug]
You need to log in
before you can comment on or make changes to this bug.
Description
•