insights: change series_id to string (hash); add index
Created by: slimsag
Today, series_id
will need to be some unique identifier of the actual series definition in the user/org/global settings, e.g. there are two unique series here:
"insights": [
{
"title": "fmt usage",
"description": "fmt.Errorf/fmt.Printf usage",
"series": [
{
"label": "fmt.Errorf",
"search": "errorf",
},
{
"label": "printf",
"search": "fmt.Printf",
}
]
}
]
The plan was to have series_id
effectively be a hash of the source of settings (user ID / org ID / global) + the actual info associated with the insight series. However, an int32 is likely not sufficient for this due to collisions. I considered using crc64 with an int64 data type, but there is still some uncomfortable room for collisions there and text is cheap - so let's just store text for now and use a sha256 hash to err on the side of caution.