Closed
Bug 527489
Opened 16 years ago
Closed 16 years ago
calls to bz_alter_column on FK referenced columns will lose their referenced status in bz_schema unless the REFERENCES hash is included
Categories
(Bugzilla :: Database, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: gregaryh, Assigned: mkanat)
Details
Attachments
(1 file)
|
996 bytes,
patch
|
gregaryh
:
review+
|
Details | Diff | Splinter Review |
This affects bugzilla 3.2+
Any calls to bz_alter_schema will overwrite the references section if they are not explicitly included in the call.
| Assignee | ||
Comment 1•16 years ago
|
||
Does this fix things, ghendricks?
| Reporter | ||
Comment 2•16 years ago
|
||
Comment on attachment 411471 [details] [diff] [review]
v1
>+ # Preserve foreign key definitions in the Schema object when altering
>+ # types.
>+ if (defined $current_def->{REFERENCES}) {
>+ # Make sure we don't modify the caller's $new_def.
>+ $new_def = dclone($new_def);
>+ $new_def->{REFERENCES} = $current_def->{REFERENCES};
>+ }
One question. How do we alter a foreign key? For example if we need to change from CASCADE delete to something else? Should there be a separate bz_alter_fk? Or do we just want to drop and recreate?
| Assignee | ||
Comment 3•16 years ago
|
||
(In reply to comment #2)
> One question. How do we alter a foreign key? For example if we need to change
> from CASCADE delete to something else? Should there be a separate bz_alter_fk?
> Or do we just want to drop and recreate?
You just drop and re-create, for now.
| Reporter | ||
Updated•16 years ago
|
Attachment #411471 -
Flags: review?(ghendricks) → review+
| Assignee | ||
Comment 4•16 years ago
|
||
ghendricks: Did you test this patch against the problem you were having?
Flags: approval+
| Assignee | ||
Comment 5•16 years ago
|
||
Checking in Bugzilla/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB.pm,v <-- DB.pm
new revision: 1.131; previous revision: 1.130
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Target Milestone: --- → Bugzilla 3.6
You need to log in
before you can comment on or make changes to this bug.
Description
•