Custom Fields again

David Miller justdave at syndicomm.com
Tue Dec 10 23:07:25 UTC 2002


On 12/10/02 2:59 PM -0800, Jonathan Schatz wrote:

> right now, the current implementation(s) of custom fields in 91037
> involves a seperate table that contains custom field information. why
> not directly update the schema in bugs.bugs instead? adding a new custom
> field wouldn't require any more info than a normal field ( field, type,
> default).other than rebuilding / recompiling templates (which isn't an
> impossible problem), the biggest issue i see is searching. perhaps we
> could break out all of the sql query generation into a seperate module,
> which would be responsible for knowing which fields do and don't exist.
>
> i don't know, it's early (for me) and i haven't had a cup of coffee yet,
> but this is the idea i've been toying with in my head. i'll most likely
> move ahead with a prototype of this internally against 2.17.1 once i've
> ported my 2.16.1 changes there, so comments / flames are welcome. i just
> don't see the need to treat custom fields any differently than "normal"
> ones...

This is actually a fair point.

We already use LearnAboutColumns() to find out what the names of the
columns are in the bugs table and just look for any field in the bug form
with the same name to insert into a bug when creating it.  A custom field
(at least for creating the bug - querying is a separate issue) would simply
be a matter of editing the enter_bug template to display it, and adding the
column to the database.  No code changes would even be required.

I think the main reason nobody's really thought of that is because of the
limit of 16 indexes on a table, and the bugs table already had that many.

Well, we require MySQL 3.22.6 right now, for precisely that reason, because
3.22.6 and up allow more than 16 indexes on a table, so that's no longer an
issue.

Process_bug.cgi may do things a little more specifically as far as what
fields are what, so that may take a little more work to be able to change a
custom field on an existing bug, but creating a bug with custom fields in
it is trivial.
-- 
Dave Miller      Project Leader, Bugzilla Bug Tracking System
http://www.justdave.net/             http://www.bugzilla.org/



More information about the developers mailing list