bruth/django-tracking2 — pull request #30 by dacox (2014-05-06 19:44:38+00:00)
Title: Pageview URL truncated by max_length

This is pull request is intended to start a discussion about how to fix it.

Currently, the Pageview model's URL field is ```CharField(max_length=500)```

Sites with dynamic content can create quite lengthy URLs. My fork is using ```max_length=2000``` so that Pageview URLs are browsable.

However, it seems like arbitrary an max_length will not work as there is no hard spec on how long a URL can be *(http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers)*.

This pull request proposes migrating the field to a TextField. In modern databases like postgresql, there is no performance penalty between ```CHAR``` and ```VARCHAR```(except for space).

>Tip: There are no performance differences between these three types, apart from increased storage size when using the blank-padded type, and a few extra cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, it has no such advantages in PostgreSQL. In most situations text or character varying should be used instead. *(http://www.postgresql.org/docs/8.3/static/datatype-character.html)*

There is also the possibility of having multiple models with different trade offs - it people care more about space than browsable history, they can choose to use the space saving ```max_length=500``` model.
I suppose that option could even be disabled or enabled by using this migration or not.