Skip to content

insights: Add an id field to insight_view_series table

Created by: CristinaBirkel

This will get us a couple of things:

  1. Currently, the series_id values returned via the API are going to change whenever a series is updated, (for backend insights anyway.) This is because behind the scenes we're not really updating anything--we're either creating a brand new series or attaching an existing one. Adding this new id field on the insight_view_series will allow us to use that as the series_id and it can remain consistent across updates. (Note: this is purely a nice-to-have for users of the API.)
  2. This will also enable us to maintain ordering of series across updates. This may only affect the edit page, (based on how we're choosing to order series in the chart,) but is still a UX consideration.

So this issue is to add that id field, and make the necessary changes to use that instead of the series_id in the API responses and for ordering. And wherever else might make sense; it seems like a fairly significant change.