a8n: Rename Threads to Changesets, add API endpoints to create Changesets
Created by: mrnugget
This PR does multiple things:
- It renames
Threads
toChangesets
. We decided to keepChangesets
andIssues
separate for now instead of combining them in aThread
sum type. See this note to the rationale behind this decision. (Note: instead of renaming the table and all of its associated indexes and constraint, we simply drop thethreads
table in a migration and create a newchangesets
table. If you previously createdthreads
, they will get deleted) - It establishes the many-to-many relationship between
Campaigns
andChangesets
by addingjsonb
columns to both tables that we use as a set of IDs. - It adds the GraphQL mutations
createChangeset
andaddChangesetToCampaign
. These allow the user to first create a changeset for a given Sourcegraph repository and a given external ID (i.e.: Sourcegraph GraphQL ID forsourcegraph/sourcegraph
and the external ID5549
to reference this pull request)
Important note: the Changeset
is still "empty". We don't sync data from an external service yet. That will be the next step.