Project

Profile

Help

Task #5609

Convert CharField to TextField where it makes sense to do so

Added by dalley 3 months ago. Updated about 1 month ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Platform Release:
Blocks Release:
Backwards Incompatible:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

Originally we had many TextFields that were converted to CharField because MySQL cannot index on TextField. However, it's no longer necessary after we decided to use PostgreSQL only.

Since "text" and "varchar" are identical in PostgreSQL, the only real benefit is removing the arbitrary 255 character limitation which is the maximum Django allows. Efficiency wise they are both essentially identical (technically speaking varchar is a little slower for the length checks).

For some fields like digests, it might make sense to keep the CharField with max length because it provides a little bit of schema information. But unless the field length actually needs to be bounded, TextField would make more sense.

Associated revisions

Revision 8e8dcb8a View on GitHub
Added by dalley 3 months ago

Convert remaining CharField to TextField

closes: #5609
https://pulp.plan.io/issues/5609

History

#1 Updated by dalley 3 months ago

  • Status changed from NEW to ASSIGNED

#2 Updated by dalley 3 months ago

  • Assignee set to dalley

#3 Updated by dalley 3 months ago

  • Status changed from ASSIGNED to POST

#4 Updated by dalley 3 months ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#5 Updated by bmbouter about 1 month ago

  • Sprint/Milestone set to 3.0.0

#6 Updated by bmbouter about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF