From b1153e0c544c12bdf6693ad50ee741347d219fd7 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Sat, 18 Jul 2026 18:22:16 +0200 Subject: [PATCH] fix: add updated_at columns to ai_proactive migration - ai_proactive_suggestions: add updated_at TIMESTAMPTZ - ai_proactive_context_log: add updated_at TIMESTAMPTZ TenantMixin inherits TimestampMixin which expects both created_at and updated_at. Missing updated_at caused 500 errors on /ai-proactive/context POST. --- app/plugins/builtins/ai_proactive/migrations/0001_initial.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/plugins/builtins/ai_proactive/migrations/0001_initial.sql b/app/plugins/builtins/ai_proactive/migrations/0001_initial.sql index 74c597c..f388bb6 100644 --- a/app/plugins/builtins/ai_proactive/migrations/0001_initial.sql +++ b/app/plugins/builtins/ai_proactive/migrations/0001_initial.sql @@ -16,6 +16,7 @@ CREATE TABLE IF NOT EXISTS ai_proactive_suggestions ( is_acted_upon BOOLEAN NOT NULL DEFAULT FALSE, context_snapshot JSONB NOT NULL DEFAULT '{}', created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), expires_at TIMESTAMPTZ, deleted_at TIMESTAMPTZ ); @@ -32,6 +33,7 @@ CREATE TABLE IF NOT EXISTS ai_proactive_context_log ( entity_id UUID, entity_data JSONB NOT NULL DEFAULT '{}', created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), deleted_at TIMESTAMPTZ ); CREATE INDEX IF NOT EXISTS ix_context_log_user_time ON ai_proactive_context_log (tenant_id, user_id, created_at DESC);