0027_auto_20160915_2038.py
2.48 KB
-
Remove HistoricalRecords from course metadata models (#332) · fff1422f
django-simple-history's HistoricalRecords conflict with django-extensions' AutoSlugField. Briefly: AutoSlugField tries to automatically generate a unique slug any time a new model instance is saved. This includes the addition of rows to historical tables. AutoSlugField attempts to generate a unique slug 100 times by appending '-i' where i is between 2 and 99, inclusive, then raises an exception, preventing a historical row from being created. This happened very quickly for models whose slug field source(s) slugify to the empty string, but would have eventually happened for all models using HistoricalRecords. This behavior renders the historical tables (which we weren't using in the first place) useless until we can exclude specific fields from historical tracking: https://github.com/treyhunner/django-simple-history/issues/165. Note that the migration included here will drop the historical tables currently in place. This is fine - the data is not useful - and should not incur downtime. An added benefit of fixing this issue by removing HistoricalRecords from course metadata models: a refresh with production data takes 11 minutes on my local machine. ECOM-5579.
Renzo Lucioni committed