Repository navigation
feat(db): add environments.machine_size (SUPER-3135) - #9706
Conversation
A nullable text column for the machine size a workspace boots at when its create names none; null means the organization's default. Nothing reads or writes it yet: the API change that uses it ships separately, after this migration is applied. The column is added without a default, so Postgres only changes the table's metadata: no rewrite, a brief lock on `environments` (about 230 rows; not a hot table).
Walkthrough
Pre-merge checks:
|
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
|
Preview update published for development build |
|
Review verdict: looks good. It is a metadata-only Findings:
Verified: the 0193 snapshot Full report: https://app.superset.sh/page/pr-9706-review-environments-machine-size-migration-rv08yc |
Links
superset/cloud-environment-onboarding(opened right after this one)Summary
environments.machine_sizetext column: the size a workspace boots at when its create names none.nullmeans the organization's default, which is every existing row.packages/trpc/AGENTS.mdrule 10 and the db-migrations checklist, so the API change can be reverted on its own.Migration safety (db-migrations checklist)
ALTER TABLE "environments" ADD COLUMN "machine_size" text;— no default and nullable, so Postgres only updates the table's metadata. There is no rewrite and no scan, just a brief ACCESS EXCLUSIVE lock onenvironments.environmentsis about 176 kB / 229 rows (measured on this workspace's Neon branch, which was copied from production today). It is not one of the hot tables (auth.*,automation_events,ingest.webhook_events), and no job holds it open.drizzle-kit generate, not hand-edited. The snapshot'sprevIdchains to 0192.PGOPTIONS="-c lock_timeout=5s -c statement_timeout=60s" bunx drizzle-kit migrate, to this workspace's own Neon branch only (br-misty-firefly…, a non-default child branch).Known deviation
environment.list/get/create/updateselect every column, so their output gainsmachineSize: nullonce this lands. That's additive, and no client reads it until the stacked PR ships.Rollout / Rollback
DROP COLUMNmigration if it's ever needed.Summary by cubic
Adds a nullable
environments.machine_sizecolumn that stores the machine size a workspace boots at when its create names none;nullmeans the organization's default, which is every existing row. This is migration-only — the API change that reads and writes the column ships in the stacked PR onsuperset/cloud-environment-onboarding, so this migration can be reverted on its own.environments(~229 rows, not a hot table); no rewrite or scan, just a brief lock.drizzle-kit generateand applied only to this workspace's Neon branch.DROP COLUMNmigration since nothing reads the column yet.Known deviation
environment.list/get/create/updateselect every column, so their output gainsmachineSize: nullonce this lands; additive, and no client reads it until the stacked PR ships.Written for commit 2b365bd. Summary will update on new commits.
Summary by CodeRabbit