From 20aefd5bf6ef39ce022d2b8a4d71c9036c6d3c51 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sun, 26 Apr 2026 11:02:44 +0200 Subject: [PATCH] =?UTF-8?q?feat(license):=20Flyway=20V5=20=E2=80=94=20lice?= =?UTF-8?q?nse=20table=20+=20environments=20retention=20columns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per-tenant license row stores the signed token, licenseId for audit, installed/expires/last_validated timestamps. environments gains three INTEGER NOT NULL DEFAULT 1 retention columns (execution, log, metric) so existing rows land inside the default-tier cap. Co-Authored-By: Claude Opus 4.7 (1M context) --- ..._license_table_and_environment_retention.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cameleer-server-app/src/main/resources/db/migration/V5__license_table_and_environment_retention.sql diff --git a/cameleer-server-app/src/main/resources/db/migration/V5__license_table_and_environment_retention.sql b/cameleer-server-app/src/main/resources/db/migration/V5__license_table_and_environment_retention.sql new file mode 100644 index 00000000..aa53ed3e --- /dev/null +++ b/cameleer-server-app/src/main/resources/db/migration/V5__license_table_and_environment_retention.sql @@ -0,0 +1,17 @@ +-- Per-tenant license row (one server = one tenant) +CREATE TABLE license ( + tenant_id TEXT PRIMARY KEY, + token TEXT NOT NULL, + license_id UUID NOT NULL, + installed_at TIMESTAMPTZ NOT NULL, + installed_by TEXT NOT NULL, + expires_at TIMESTAMPTZ NOT NULL, + last_validated_at TIMESTAMPTZ NOT NULL +); + +-- Per-env retention; defaults to default-tier values (1 day) so a fresh +-- server lands inside the cap without operator intervention. +ALTER TABLE environments + ADD COLUMN execution_retention_days INTEGER NOT NULL DEFAULT 1, + ADD COLUMN log_retention_days INTEGER NOT NULL DEFAULT 1, + ADD COLUMN metric_retention_days INTEGER NOT NULL DEFAULT 1;