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'));