Deployment Portalv0.1
MQMuhammad Qazi
Deployment Portal

Migrations

cmd/migrate · run before roll out, once per release
Schema
0013latestapplying to production
Drift
0environmentsstaging = production − 0
Longest lock
1.1s0009 · partition
Irreversible
3of 13no down.sql

Migrations by environment

VersionNameProductionStagingPreviewTookLockReversible
0013projects_search_tsvectorapplyingapplied1200 ms0.3 sdown.sql
0012projects_add_archived_atappliedappliedapplied41 msdown.sql
0011org_invites_token_hashappliedappliedapplied88 ms no
0010river_v6appliedappliedapplied302 ms no
0009audit_events_partitionappliedappliedapplied1204 ms1.1 s no
0008settings_historyappliedappliedapplied27 msdown.sql

0013_projects_search_tsvector

up.sql
-- adds a generated tsvector and a GIN index; concurrently, no long lock
ALTER TABLE projects
  ADD COLUMN search tsvector
  GENERATED ALWAYS AS (to_tsvector('simple', name || ' ' || coalesce(description, ''))) STORED;

CREATE INDEX CONCURRENTLY projects_search_idx
  ON projects USING gin (search);

Policy

what ship checks before it runs a migration
  • Runs once per release, on one instance, before the roll out starts.
  • Fails the release if a lock is not acquired in 10 s; nothing is rolled out.
  • Migrations that drop columns or tables need a second approval.
  • 3 migrations have no down.sql; a rollback of those releases keeps the schema.