From 0fccdb636fa3f627b6b4fc822b21a0e280f470d3 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Wed, 8 Apr 2026 20:15:01 +0200 Subject: [PATCH] feat(db): add V7 deployment orchestration migration Adds target_state, deployment_strategy, replica_states (JSONB), and deploy_stage columns to the deployments table with backfill logic. --- .../db/migration/V7__deployment_orchestration.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cameleer3-server-app/src/main/resources/db/migration/V7__deployment_orchestration.sql diff --git a/cameleer3-server-app/src/main/resources/db/migration/V7__deployment_orchestration.sql b/cameleer3-server-app/src/main/resources/db/migration/V7__deployment_orchestration.sql new file mode 100644 index 00000000..79b5aa59 --- /dev/null +++ b/cameleer3-server-app/src/main/resources/db/migration/V7__deployment_orchestration.sql @@ -0,0 +1,12 @@ +-- Deployment orchestration: status model, replicas, strategies, progress tracking + +ALTER TABLE deployments ADD COLUMN target_state VARCHAR(20) NOT NULL DEFAULT 'RUNNING'; +ALTER TABLE deployments ADD COLUMN deployment_strategy VARCHAR(20) NOT NULL DEFAULT 'BLUE_GREEN'; +ALTER TABLE deployments ADD COLUMN replica_states JSONB NOT NULL DEFAULT '[]'; +ALTER TABLE deployments ADD COLUMN deploy_stage VARCHAR(30); + +-- Backfill existing deployments +UPDATE deployments SET target_state = CASE + WHEN status = 'STOPPED' THEN 'STOPPED' + ELSE 'RUNNING' +END;