justquick / django-activity-stream

Generate generic activity streams from the actions on your site. Users can follow any actors' activities for personalized streams.
http://django-activity-stream.rtfd.io/en/latest/
BSD 3-Clause "New" or "Revised" License
2.38k stars 482 forks source link

Ability to opt into `USE_JSONFIELD` after initially having it as False #443

Closed musemby closed 2 years ago

musemby commented 4 years ago

If a user starts off with USE_JSONFIELD set to False because they do not need to use .data but then later on realize they do need it, there is no clean way to add the data field to the action model. The migration 0002_remove_action_data removes the field if USE_JSONFIELD is False initially but there is no migration to add it later. Otherwise it should be explicitly mentioned as a caveat on the documentation.

cb109 commented 4 years ago

@musemby I agree this should me more prominent on the docs: Problem is that the latest readthedocs version is super outdated and needs to be rebuild from master. See https://github.com/justquick/django-activity-stream/blob/master/docs/source/data.rst

You can add the data field later on, I did that a year or so ago. This was my step-by-step recipe, you may have to change which library you are un/installing, as that currently specifies which JSONField to use:

actstream: Adding a data JSONField with django_mysql to an existing project