From 4d5f3e43ddc748866afe3ee34d46cf635af3bb21 Mon Sep 17 00:00:00 2001 From: Tomasz Edward Posluszny Date: Sat, 19 Sep 2026 16:38:21 +0200 Subject: [PATCH] docs(controlplane): fix stale schema change instructions The data model section told contributors to create the versioned migration with make migration_new. That target stopped diffing the Ent schema in ef06a7ca (#557, March 2024), where it became atlas migrate new and the diff behaviour moved to migration_sync, which generate now depends on. Following the step as written produces an empty migration. Document the current procedure and note that a data backfill is a separate, hand-written migration. Assisted-by: Claude Code Signed-off-by: Tomasz Edward Posluszny --- app/controlplane/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controlplane/README.md b/app/controlplane/README.md index 60f6051b7..d93ac3a80 100644 --- a/app/controlplane/README.md +++ b/app/controlplane/README.md @@ -78,8 +78,8 @@ The way you can make a change in the data model is **Update the schema** - Add a new/update an existing entity via a schema update. Schemas can be found at `pkg/data/ent/schema` -- Generate the code changes associated with that schema change. `make generate` -- Generate a new versioned migration `make migration_new`. This will create a new migration file at `pkg/data/ent/migrate/migrations +- Run `make -C app/controlplane generate`. It generates both the code changes associated with that schema change and, via `make migration_sync`, a new versioned migration at `pkg/data/ent/migrate/migrations`. Review and commit that generated file - do not hand-write it. Note the root `make generate` does **not** write migrations. +- If the change also needs a data backfill, add a **second**, hand-written migration with `make -C app/controlplane migration_new` (which creates an empty file), as in the `last_run_at` backfill `20251001215625.sql`. **Apply the schema change in development DB** - `make migration_apply` will apply the migration to the development database