Add CampaignSpecs & ChangesetSpecs tables, type definitions and campaigns.Store support
Created by: mrnugget
Merge target of this PR is https://github.com/sourcegraph/sourcegraph/pull/11675, which will contain the new campaigns workflow and allows us to merge without breaking master.
This is the next step to build up the necessary CRUD pieces and adds:
- a
campaign_specs
table, aCampaignSpec
type definition and methods incampaigns.Store
- same goes for
ChangesetSpec
The schema is:
- a
campaign
can have onecampaign_spec
- a
campaign_spec
can have manychangeset_spec
Most notable is that changeset_specs.campaign_spec_id
is nullable so that users can create ChangesetSpecs
individually and then attach them to CampaignSpecs
.
And both tables have a new rand_id
column that contains a short, unguessable text ID that we can use as an external GraphQL node ID for both.
Other than that: this is just the usual boilerplate that we used before. Major difference is that I made the tests a bit cleaner and created separate files (!) which I think we should do for the other tables too. It's far easier to work with.