Open Bug 287314 Opened 20 years ago Updated 11 years ago

Move bugs.rep_platform to use an integer instead of a varchar

Categories

(Bugzilla :: Database, enhancement)

2.19.2
enhancement
Not set
normal

Tracking

()

People

(Reporter: mkanat, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

I think that this one will be the easiest to start with.
Assignee: general → kevin.benton
I am unable to work this bug at this time due to other priorities. Reassigning to default assignee.
Assignee: kevin.benton → general
Will it work for an upgrade from an enum directly to a rep_platform with ids, without the in between varchar step?
Attachment #380392 - Flags: review?(mkanat)
Attachment #380392 - Flags: review?(mkanat) → review-
Comment on attachment 380392 [details] [diff] [review] updated Install::DB and DB::Schema Instead of removing lines from Install::DB, you should wrap them in a bz_column_info call that checks the type of the field and only does the change if necessary at that point in time. Also, you can just do a selectcol_arrayref with a {Cols=>[1,2]} argument instead of doing that "prepare, execute, fetch" thing, and then put it into a hash. Also, don't insert $dbh->quoted strings right into SQL!! Use placeholders!
How do I check for ENUM type? Will this work? $dbh->bz_column_info('bugs', 'rep_platform')->{TYPE} eq "ENUM"
Attachment #380392 - Attachment is obsolete: true
Attachment #380593 - Flags: review?(mkanat)
Attachment #380593 - Flags: review?(mkanat) → review-
Comment on attachment 380593 [details] [diff] [review] Using selectcol_arrayref and placeholders Those aren't ENUM types there. That's not where the ENUM change happens, and you never, ever have to worry about any field ever being an ENUM, in Install::DB.
Attached patch Removed ENUM (obsolete) — Splinter Review
Attachment #380593 - Attachment is obsolete: true
Attachment #408598 - Flags: review?(mkanat)
Shouldn't Search.pm be fixed too?
Comment on attachment 408598 [details] [diff] [review] Removed ENUM There's a huge amount of other code that needs to be fixed in addition to this. All of Bugzilla needs to search and view the value in addition to just fixing the DB. Also, the migration code is incorrect. You changed the field to an integer (thus destroying all data in it) before you fixed it. You need to fix the values first and then convert it to an integer.
Attachment #408598 - Flags: review?(mkanat) → review-
I'm making changes for bug_severity, op_sys, priority and rep_platform together because many functions like get_legal_field_values in Bugzilla::Field are common to all of them. I am also able to create a new bug with these changes. Please review and let me know if I'm on the right track here.
Attachment #408598 - Attachment is obsolete: true
Attachment #408816 - Flags: review?(mkanat)
Comment on attachment 408816 [details] [diff] [review] updating all bug_fields and create bug This looks good, but this patch alone is pretty useless as nothing can be tested. The rest of the code still needs to be fixed.
Attachment #408816 - Flags: review?(mkanat)
Component: Bugzilla-General → Database
Assignee: general → database
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: