From 8aa59bdb51fbe44fb8bb4b93ff57e7eefc6f603c Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sat, 17 Oct 2026 21:55:42 +1100 Subject: [PATCH] fix(postgres): allow the agent org upgrade phase --- .../migrations/0052_org_upgrade_agent_phase.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 internal/infrastructure/postgres/migrations/0052_org_upgrade_agent_phase.sql diff --git a/internal/infrastructure/postgres/migrations/0052_org_upgrade_agent_phase.sql b/internal/infrastructure/postgres/migrations/0052_org_upgrade_agent_phase.sql new file mode 100644 index 000000000..22819ee80 --- /dev/null +++ b/internal/infrastructure/postgres/migrations/0052_org_upgrade_agent_phase.sql @@ -0,0 +1,14 @@ +-- The seeded agent identity is created by its own resumable upgrade phase. + +-- +goose Up + +ALTER TABLE org_upgrades DROP CONSTRAINT org_upgrades_phase_check; +ALTER TABLE org_upgrades ADD CONSTRAINT org_upgrades_phase_check + CHECK (phase IN ('state_store', 'edastore', 'operator', 'agent')); + +-- +goose Down + +DELETE FROM org_upgrades WHERE phase = 'agent'; +ALTER TABLE org_upgrades DROP CONSTRAINT org_upgrades_phase_check; +ALTER TABLE org_upgrades ADD CONSTRAINT org_upgrades_phase_check + CHECK (phase IN ('state_store', 'edastore', 'operator'));