Closed atodorov closed 3 years ago
TextField with db_index will fail on MySQL/MariaDB b/c there's no fixed size specified. Works fine on Postgres. In a different library that was solved by changing object_pk to CharField(max_length=64). See bartTC/django-attachments#81
Any objections to do the same here ?
@claudep ^^^
I think that transforming TextField
to CharField(max_length=64)
for object_id
should be fine for a vast majority of use cases. We could even describe how to keep the TextField object_id
by a custom Comment model if really needed.
@carltongibson, @felixxm, do you think this would be an acceptable backwards incompatibility? My hopes of getting auto-limited MySQL index sizes (in the spirit of https://github.com/django/django/pull/8848/files) are now very thin.
I've converted object_pk
field to CharField
and updated the history in case you decide this looks good enough and want to merge. Thanks for reviewing.
@claudep I think it's fine. Docs changes are missing, e.g. https://github.com/django/django-contrib-comments/blob/ab3e0e6afa0af0a478ce024f3f398134da7d778f/docs/models.txt#L29-L33
@atodorov, thanks for your patient work on this. I think it's good to go.
TextField with db_index will fail on MySQL/MariaDB b/c there's no fixed size specified. Works fine on Postgres. In a different library that was solved by changing object_pk to CharField(max_length=64). See https://github.com/bartTC/django-attachments/pull/81
Any objections to do the same here ?
Note2: the reported PASS result means there's no testing with MySQL here so that also needs to be added. I can work on it if the CharField change is accepted.