Closed Bug 299508 Opened 19 years ago Closed 10 years ago

The fielddefs table does not translate well across installations

Categories

(Bugzilla :: Bugzilla-General, defect)

2.19.2
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mkanat, Unassigned)

Details

This problem came up for me at first when I was using my bzdbcopy script to copy
an installation from MySQL to PostgreSQL. However, the inherent problems could
come up frequently.

Basically, we depend on the fieldid as a foreign key for the bugs_activity
table. However, checksetup creates the fields in a basically random order, and
assigns them whatever the latest fieldid is.

So, depending on when you installed your Bugzilla, all your fields have
different fieldids.

This is a problem when doing things like merging Bugzilla installations, for
example.

For the bzdbcopy issue, it's a problem because one field has a different actual
"name" on PostgreSQL than it does on MySQL. On PostgreSQL it is:

(TO_CHAR(NOW(), 'J')::int - TO_CHAR(bugs.delta_ts, 'J')::int)

And on MySQL it's something different. AddFDef doesn't deal well with that.

I could special-case that in bzdbcopy, I also wanted to file a bug to point out
the larger issue of fieldids being inconsistent across installations.
(In reply to Max Kanat-Alexander from comment #0)
> So, depending on when you installed your Bugzilla, all your fields have
> different fieldids.

That is expected, especially now that we have custom fields. There is nothing you can do about that.


> For the bzdbcopy issue, it's a problem because one field has a different actual
> "name" on PostgreSQL than it does on MySQL.

This problem has been fixed a long time ago. Now all DB servers use the same names.


> I also wanted to file a bug to point out
> the larger issue of fieldids being inconsistent across installations.

This is an internal value and you should point to the name instead for consistency if you want to do cross-DB stuff.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.