Documentation
¶
Index ¶
- Variables
- type Migrations
- func (m *Migrations) All() []migrations.Migration
- func (m *Migrations) DeleteAccountsAndSetUUIDAsEmail(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) GetAccountsWithEmptyEmails(ctx context.Context, db *gorm.DB) ([]app.Account, error)
- func (m *Migrations) Migration002DropOldActionsRunIndex(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration09NullWorkflowInstallID(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration086RunnerGroupSettingsBackfillGroups(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration087InstallWorkflowsBackfillOwnership(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration088AccountsEmailsNotEmpty(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration089AppBracnhesCleanup(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration091DeleteOrphanedActionTriggers(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration092BackfillOrgID(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration093AddAdhocActions(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration094VCSCommitPolymorphicOwnership(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration095BackfillOrgSupportRole(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration096BackfillInstallSandboxMode(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration097BackfillRunnerGroupOwnerName(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration098BackfillQueueSignalEnqueueFinishedAt(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration099AppConfigBackfillStatusV2(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration100FixApprovalOptionDefault(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration101SlackChannelSubsCreatorCheck(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration102WebhooksMatch(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration103QueueSignalsInflightIndex(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration104FixStuckGenerateWorkflowStepsSignals(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration105FixSkipNoopsDefault(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration106BackfillQueueSignalExpiresAt(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration107BackfillEmitterSignalExpiresIn(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration108InstallWorkflowsNameHookManaged(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration109BackfillRunbookStepDeployDependents(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration110CanonicalizeRunbookStepDeployType(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration111BackfillLifecyclePhase(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration112RunnerJobAvailableNotifyTrigger(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration113BackfillRunnerHealthcheckEmitter(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration115VcsConnectionUniqueWithDeletedAt(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration116InstallAppConfigVersionMetadataBackfill(ctx context.Context, db *gorm.DB) error
- func (m *Migrations) Migration117AppBranchUniqueWithDeletedAt(ctx context.Context, db *gorm.DB) error
- type Params
Constants ¶
This section is empty.
Variables ¶
var RunnerGroupSettingsBackfillGroupsSQL string
var RunnerJobAvailableNotifyTriggerSQL string
Functions ¶
This section is empty.
Types ¶
type Migrations ¶
type Migrations struct {
// contains filtered or unexported fields
}
func New ¶
func New(params Params) *Migrations
func (*Migrations) All ¶
func (m *Migrations) All() []migrations.Migration
func (*Migrations) DeleteAccountsAndSetUUIDAsEmail ¶
func (*Migrations) GetAccountsWithEmptyEmails ¶
func (*Migrations) Migration002DropOldActionsRunIndex ¶
func (*Migrations) Migration09NullWorkflowInstallID ¶
func (*Migrations) Migration086RunnerGroupSettingsBackfillGroups ¶
func (*Migrations) Migration087InstallWorkflowsBackfillOwnership ¶
func (*Migrations) Migration088AccountsEmailsNotEmpty ¶
func (*Migrations) Migration089AppBracnhesCleanup ¶
func (*Migrations) Migration091DeleteOrphanedActionTriggers ¶
func (*Migrations) Migration092BackfillOrgID ¶
func (*Migrations) Migration093AddAdhocActions ¶ added in v0.19.784
func (*Migrations) Migration094VCSCommitPolymorphicOwnership ¶ added in v0.19.850
func (*Migrations) Migration095BackfillOrgSupportRole ¶ added in v0.19.870
func (*Migrations) Migration096BackfillInstallSandboxMode ¶ added in v0.19.894
func (*Migrations) Migration097BackfillRunnerGroupOwnerName ¶ added in v0.19.894
func (*Migrations) Migration098BackfillQueueSignalEnqueueFinishedAt ¶ added in v0.19.903
func (m *Migrations) Migration098BackfillQueueSignalEnqueueFinishedAt(ctx context.Context, db *gorm.DB) error
Migration098BackfillQueueSignalEnqueueFinishedAt sets enqueue_finished_at on all existing queue signals that don't have it and marks them as enqueued. This ensures a clean baseline when the background-enqueue change rolls out.
func (*Migrations) Migration099AppConfigBackfillStatusV2 ¶ added in v0.19.915
Migration099AppConfigBackfillStatusV2 backfills the status_v2 JSONB column from the legacy v1 status + status_description fields for all app_configs that don't yet have a v2 status set.
func (*Migrations) Migration100FixApprovalOptionDefault ¶ added in v0.19.915
Migration100FixApprovalOptionDefault fixes the approval_option column default from 'auto' (invalid) to 'prompt' and backfills existing rows.
func (*Migrations) Migration101SlackChannelSubsCreatorCheck ¶ added in v0.19.927
func (m *Migrations) Migration101SlackChannelSubsCreatorCheck(ctx context.Context, db *gorm.DB) error
Migration101SlackChannelSubsCreatorCheck enforces the creator-present invariant on slack_channel_subscriptions: at least one creator identity must be recorded (Slack user OR Nuon account), so a row can always be attributed. GORM doesn't model multi-column CHECKs cleanly, so it lives here as a raw constraint.
func (*Migrations) Migration102WebhooksMatch ¶ added in v0.19.927
Migration102WebhooksMatch extends the webhooks unique index to include the new match_canonical column so a single (org, url) can be subscribed multiple times with different routing predicates (e.g., once for "all installs" and again for "components in env=prod"). The actual `match` and `match_canonical` columns, plus the new composite index `idx_webhooks_org_url_match`, are added by GORM AutoMigrate (the `gorm-migrations` step in plugins/migrations/exec.go) from the `app.Webhook` struct tags. AutoMigrate runs BEFORE this custom migration, but it does NOT drop indexes that have been removed from struct tags — so the legacy `idx_webhooks_org_url` lingers and must be dropped here.
On an existing DB the effective sequence is:
- AutoMigrate adds `match` (jsonb, nullable) and `match_canonical` (text not null, defaulting to the empty string). Existing rows are backfilled to the empty string by that default.
- AutoMigrate creates `idx_webhooks_org_url_match` on (org_id, webhook_url, match_canonical, deleted_at). Because every existing row has an empty match_canonical, uniqueness reduces to (org_id, webhook_url, deleted_at), already enforced by the legacy index, so the new index builds without conflicts.
- This migration drops the now-redundant legacy `idx_webhooks_org_url`.
Idempotent via DROP INDEX IF EXISTS so re-runs on already-migrated environments are no-ops.
func (*Migrations) Migration103QueueSignalsInflightIndex ¶ added in v0.19.932
Replaces a manually-created sibling whose partial predicate referenced 'in_progress' instead of the Go enum value 'in-progress', so it was never used.
func (*Migrations) Migration104FixStuckGenerateWorkflowStepsSignals ¶ added in v0.19.947
func (*Migrations) Migration105FixSkipNoopsDefault ¶ added in v0.19.947
Migration105FixSkipNoopsDefault resets skip_noops to false for all component config connections that were created with the incorrect default of true.
func (*Migrations) Migration106BackfillQueueSignalExpiresAt ¶ added in v0.19.969
func (m *Migrations) Migration106BackfillQueueSignalExpiresAt(ctx context.Context, db *gorm.DB) error
Migration106BackfillQueueSignalExpiresAt sets expires_at = created_at + 1 hour for all existing process_healthcheck and healthcheck signals that don't already have an expiry, and sets signal_expires_in on existing emitters so newly emitted signals also get an expiry. This prevents 600k+ stale handler workflows from accumulating.
func (*Migrations) Migration107BackfillEmitterSignalExpiresIn ¶ added in v0.19.970
func (m *Migrations) Migration107BackfillEmitterSignalExpiresIn(ctx context.Context, db *gorm.DB) error
Migration107BackfillEmitterSignalExpiresIn sets signal_expires_in = 1 hour for all emitters that don't already have one, so emitted signals expire instead of accumulating indefinitely.
func (*Migrations) Migration108InstallWorkflowsNameHookManaged ¶ added in v0.19.974
func (m *Migrations) Migration108InstallWorkflowsNameHookManaged(ctx context.Context, db *gorm.DB) error
Migration108InstallWorkflowsNameHookManaged converts install_workflows.name from a STORED generated column (previous, never-shipped migration) to a plain TEXT column populated by Workflow.BeforeSave / computeWorkflowName.
The backfill below is the last time this title expression appears in SQL. Going forward the source of truth is computeWorkflowName (Go); new rows get their name from the hook on INSERT/UPDATE.
func (*Migrations) Migration109BackfillRunbookStepDeployDependents ¶ added in v0.19.1006
func (m *Migrations) Migration109BackfillRunbookStepDeployDependents(ctx context.Context, db *gorm.DB) error
Migration109BackfillRunbookStepDeployDependents copies values from the legacy `deploy_dependencies` column to the new `deploy_dependents` column on runbook_step_configs. The field was renamed because the original name was misleading — the behavior walks the downstream subgraph (dependents), not upstream dependencies. The old column is left in place so a rollback can fall back to it.
func (*Migrations) Migration110CanonicalizeRunbookStepDeployType ¶ added in v0.19.1006
func (m *Migrations) Migration110CanonicalizeRunbookStepDeployType(ctx context.Context, db *gorm.DB) error
Migration110CanonicalizeRunbookStepDeployType rewrites the legacy 'deploy' runbook step type to its canonical name, 'component_deploy'. The rename was made to match 'component_tear_down'; the API and config layers still accept 'deploy' on input and canonicalize at ingress, so this only normalizes existing rows.
func (*Migrations) Migration111BackfillLifecyclePhase ¶ added in v0.19.1006
func (*Migrations) Migration112RunnerJobAvailableNotifyTrigger ¶ added in v0.19.1006
func (*Migrations) Migration113BackfillRunnerHealthcheckEmitter ¶ added in v0.19.1010
func (*Migrations) Migration115VcsConnectionUniqueWithDeletedAt ¶ added in v0.19.1025
func (*Migrations) Migration116InstallAppConfigVersionMetadataBackfill ¶ added in v0.19.1038
func (*Migrations) Migration117AppBranchUniqueWithDeletedAt ¶ added in v0.19.1038
Source Files
¶
- 001_service_accounts.go
- 002_actions_run_index.go
- 086_runner_group_settings_backfill_groups.go
- 087_install_workflows_backfill_ownership.go
- 088_accounts_email_not_empty.go
- 089_app_branches_cleanup.go
- 090_workflow_step_null_install_id.go
- 091_delete_orphaned_action_triggers.go
- 092_backfill_terraform_org_id.go
- 093_add_adhoc_actions.go
- 094_vcs_commit_polymorphic_ownership.go
- 095_backfill_org_support_role.go
- 096_backfill_install_sandbox_mode.go
- 097_backfill_runner_group_owner_name.go
- 098_backfill_queue_signal_enqueue_finished_at.go
- 099_app_config_backfill_status_v2.go
- 100_fix_approval_option_default.go
- 101_slack_channel_subs_creator_check.go
- 102_webhooks_match.go
- 103_queue_signals_inflight_index.go
- 104_fix_stuck_generate_workflow_steps_signals.go
- 105_fix_skip_noops_default.go
- 106_backfill_queue_signal_expires_at.go
- 107_backfill_emitter_signal_expires_in.go
- 108_install_workflows_name_hook_managed.go
- 109_backfill_runbook_step_deploy_dependents.go
- 110_canonicalize_runbook_step_deploy_type.go
- 111_backfill_lifecycle_phase.go
- 112_runner_job_available_notify_trigger.go
- 113_backfill_runner_healthcheck_emitter.go
- 115_vcs_connection_unique_with_deleted_at.go
- 116_install_app_config_version_metadata_backfill.go
- 117_app_branch_unique_with_deleted_at.go
- all.go
- migrations.go