From 88a85d5e8691061bc933d8e7c88e66e4a825a804 Mon Sep 17 00:00:00 2001 From: cherninkiy Date: Thu, 14 May 2026 15:30:36 +0300 Subject: [PATCH] fix(db): change state_data column from jsonb to text to fix 22P02 error --- db/init.sql | 2 +- src/Worker/Data/AppDbContext.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/init.sql b/db/init.sql index 3eadd13..7e66871 100644 --- a/db/init.sql +++ b/db/init.sql @@ -56,7 +56,7 @@ CREATE TABLE IF NOT EXISTS workflow_checkpoints ( agent_name VARCHAR(128) NOT NULL, document_id UUID NOT NULL, current_activity VARCHAR(128) NOT NULL, - state_data JSONB, + state_data TEXT, is_completed BOOLEAN NOT NULL DEFAULT FALSE, is_failed BOOLEAN NOT NULL DEFAULT FALSE, error_message TEXT, diff --git a/src/Worker/Data/AppDbContext.cs b/src/Worker/Data/AppDbContext.cs index 577c02a..e82e625 100644 --- a/src/Worker/Data/AppDbContext.cs +++ b/src/Worker/Data/AppDbContext.cs @@ -43,7 +43,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasKey(e => e.Id); entity.Property(e => e.AgentName).HasMaxLength(128).IsRequired(); entity.Property(e => e.CurrentActivity).HasMaxLength(128).IsRequired(); - entity.Property(e => e.StateData).HasColumnType("jsonb"); + entity.Property(e => e.StateData).HasColumnType("text"); entity.Property(e => e.ErrorMessage).HasMaxLength(4096); entity.HasIndex(e => new { e.AgentName, e.DocumentId }); entity.HasIndex(e => e.IsCompleted);