fix(db): update SQL default values and types for consistency
Some checks failed
CI / build-and-test (push) Failing after -31m34s
Some checks failed
CI / build-and-test (push) Failing after -31m34s
* Corrected default values for various fields in SQL schema * Changed tags field type from text[] to text[] with proper default * Updated JSONB default values to remove unnecessary quotes
This commit is contained in:
2
go.mod
2
go.mod
@@ -3,7 +3,7 @@ module git.warky.dev/wdevs/amcs
|
||||
go 1.26.1
|
||||
|
||||
require (
|
||||
github.com/bitechdev/ResolveSpec v1.0.86
|
||||
github.com/bitechdev/ResolveSpec v1.0.87
|
||||
github.com/google/jsonschema-go v0.4.2
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/jackc/pgx/v5 v5.9.1
|
||||
|
||||
2
go.sum
2
go.sum
@@ -36,6 +36,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bitechdev/ResolveSpec v1.0.86 h1:a4yFMMDizrmvDOV61cj/+kD+mEtKL/5EIHY2GcP3uJU=
|
||||
github.com/bitechdev/ResolveSpec v1.0.86/go.mod h1:YZOY2YCD0Kmb+pjAMhOqPh4q82Hij57F/CLlCMkzT78=
|
||||
github.com/bitechdev/ResolveSpec v1.0.87 h1:zLiHynLK8LLpXIfCZOjL5Iy1COBS6YZcWE1BHKfYqbA=
|
||||
github.com/bitechdev/ResolveSpec v1.0.87/go.mod h1:YZOY2YCD0Kmb+pjAMhOqPh4q82Hij57F/CLlCMkzT78=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf h1:TqhNAT4zKbTdLa62d2HDBFdvgSbIGB3eJE8HqhgiL9I=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf/go.mod h1:r5xuitiExdLAJ09PR7vBVENGvp4ZuTBeWTGtxuX3K+c=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||
|
||||
@@ -114,6 +114,11 @@ func resolveSpecModels() []resolveSpecModel {
|
||||
{schema: "public", entity: "maintenance_tasks", model: generatedmodels.ModelPublicMaintenanceTasks{}},
|
||||
{schema: "public", entity: "meal_plans", model: generatedmodels.ModelPublicMealPlans{}},
|
||||
{schema: "public", entity: "opportunities", model: generatedmodels.ModelPublicOpportunities{}},
|
||||
{schema: "public", entity: "plan_dependencies", model: generatedmodels.ModelPublicPlanDependencies{}},
|
||||
{schema: "public", entity: "plan_guardrails", model: generatedmodels.ModelPublicPlanGuardrails{}},
|
||||
{schema: "public", entity: "plan_related_plans", model: generatedmodels.ModelPublicPlanRelatedPlans{}},
|
||||
{schema: "public", entity: "plan_skills", model: generatedmodels.ModelPublicPlanSkills{}},
|
||||
{schema: "public", entity: "plans", model: generatedmodels.ModelPublicPlans{}},
|
||||
{schema: "public", entity: "professional_contacts", model: generatedmodels.ModelPublicProfessionalContacts{}},
|
||||
{schema: "public", entity: "project_guardrails", model: generatedmodels.ModelPublicProjectGuardrails{}},
|
||||
{schema: "public", entity: "project_skills", model: generatedmodels.ModelPublicProjectSkills{}},
|
||||
|
||||
@@ -15,7 +15,7 @@ type ModelPublicAgentGuardrails struct {
|
||||
Description resolvespec_common.SqlString `bun:"description,type:text,default:'',notnull," json:"description"`
|
||||
Name resolvespec_common.SqlString `bun:"name,type:text,notnull," json:"name"`
|
||||
Severity resolvespec_common.SqlString `bun:"severity,type:text,default:'medium',notnull," json:"severity"`
|
||||
Tags resolvespec_common.SqlString `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"`
|
||||
RelGuardrailIDPublicPlanGuardrails []*ModelPublicPlanGuardrails `bun:"rel:has-many,join:id=guardrail_id" json:"relguardrailidpublicplanguardrails,omitempty"` // Has many ModelPublicPlanGuardrails
|
||||
RelGuardrailIDPublicProjectGuardrails []*ModelPublicProjectGuardrails `bun:"rel:has-many,join:id=guardrail_id" json:"relguardrailidpublicprojectguardrails,omitempty"` // Has many ModelPublicProjectGuardrails
|
||||
|
||||
@@ -14,7 +14,7 @@ type ModelPublicAgentSkills struct {
|
||||
CreatedAt resolvespec_common.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),notnull," json:"created_at"`
|
||||
Description resolvespec_common.SqlString `bun:"description,type:text,default:'',notnull," json:"description"`
|
||||
Name resolvespec_common.SqlString `bun:"name,type:text,notnull," json:"name"`
|
||||
Tags resolvespec_common.SqlString `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"`
|
||||
RelRelatedSkillIDPublicLearnings []*ModelPublicLearnings `bun:"rel:has-many,join:id=related_skill_id" json:"relrelatedskillidpubliclearnings,omitempty"` // Has many ModelPublicLearnings
|
||||
RelSkillIDPublicPlanSkills []*ModelPublicPlanSkills `bun:"rel:has-many,join:id=skill_id" json:"relskillidpublicplanskills,omitempty"` // Has many ModelPublicPlanSkills
|
||||
|
||||
@@ -12,7 +12,7 @@ type ModelPublicEmbeddings struct {
|
||||
ID resolvespec_common.SqlInt64 `bun:"id,type:bigserial,pk,autoincrement," json:"id"`
|
||||
CreatedAt resolvespec_common.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),nullzero," json:"created_at"`
|
||||
Dim int32 `bun:"dim,type:int,notnull," json:"dim"`
|
||||
Embedding resolvespec_common.SqlString `bun:"embedding,type:vector,notnull," json:"embedding"`
|
||||
Embedding resolvespec_common.SqlVector `bun:"embedding,type:vector,notnull," json:"embedding"`
|
||||
GUID resolvespec_common.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"`
|
||||
Model resolvespec_common.SqlString `bun:"model,type:text,notnull,unique:uidx_embeddings_thought_id_model," json:"model"`
|
||||
ThoughtID resolvespec_common.SqlUUID `bun:"thought_id,type:uuid,notnull,unique:uidx_embeddings_thought_id_model," json:"thought_id"`
|
||||
|
||||
@@ -28,7 +28,7 @@ type ModelPublicLearnings struct {
|
||||
Status resolvespec_common.SqlString `bun:"status,type:text,default:'pending',notnull," json:"status"`
|
||||
Summary resolvespec_common.SqlString `bun:"summary,type:text,notnull," json:"summary"`
|
||||
SupersedesLearningID resolvespec_common.SqlUUID `bun:"supersedes_learning_id,type:uuid,nullzero," json:"supersedes_learning_id"`
|
||||
Tags resolvespec_common.SqlString `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"`
|
||||
RelDuplicateOfLearningID *ModelPublicLearnings `bun:"rel:has-one,join:duplicate_of_learning_id=id" json:"relduplicateoflearningid,omitempty"` // Has one ModelPublicLearnings
|
||||
RelProjectID *ModelPublicProjects `bun:"rel:has-one,join:project_id=guid" json:"relprojectid,omitempty"` // Has one ModelPublicProjects
|
||||
|
||||
@@ -21,7 +21,7 @@ type ModelPublicPlans struct {
|
||||
ReviewedBy resolvespec_common.SqlString `bun:"reviewed_by,type:text,nullzero," json:"reviewed_by"`
|
||||
Status resolvespec_common.SqlString `bun:"status,type:text,default:'draft',notnull," json:"status"` // draft, active, blocked, completed, cancelled, superseded
|
||||
SupersedesPlanID resolvespec_common.SqlUUID `bun:"supersedes_plan_id,type:uuid,nullzero," json:"supersedes_plan_id"`
|
||||
Tags resolvespec_common.SqlString `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Title resolvespec_common.SqlString `bun:"title,type:text,notnull," json:"title"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"`
|
||||
RelProjectID *ModelPublicProjects `bun:"rel:has-one,join:project_id=guid" json:"relprojectid,omitempty"` // Has one ModelPublicProjects
|
||||
|
||||
@@ -20,7 +20,7 @@ type ModelPublicProfessionalContacts struct {
|
||||
Name resolvespec_common.SqlString `bun:"name,type:text,notnull," json:"name"`
|
||||
Notes resolvespec_common.SqlString `bun:"notes,type:text,nullzero," json:"notes"`
|
||||
Phone resolvespec_common.SqlString `bun:"phone,type:text,nullzero," json:"phone"`
|
||||
Tags resolvespec_common.SqlString `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Title resolvespec_common.SqlString `bun:"title,type:text,nullzero," json:"title"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"`
|
||||
RelContactIDPublicContactInteractions []*ModelPublicContactInteractions `bun:"rel:has-many,join:id=contact_id" json:"relcontactidpubliccontactinteractions,omitempty"` // Has many ModelPublicContactInteractions
|
||||
|
||||
@@ -20,7 +20,7 @@ type ModelPublicRecipes struct {
|
||||
PrepTimeMinutes resolvespec_common.SqlInt32 `bun:"prep_time_minutes,type:int,nullzero," json:"prep_time_minutes"`
|
||||
Rating resolvespec_common.SqlInt32 `bun:"rating,type:int,nullzero," json:"rating"`
|
||||
Servings resolvespec_common.SqlInt32 `bun:"servings,type:int,nullzero," json:"servings"`
|
||||
Tags resolvespec_common.SqlString `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
Tags resolvespec_common.SqlStringArray `bun:"tags,type:text,default:'{}',notnull," json:"tags"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),notnull," json:"updated_at"`
|
||||
RelRecipeIDPublicMealPlans []*ModelPublicMealPlans `bun:"rel:has-many,join:id=recipe_id" json:"relrecipeidpublicmealplans,omitempty"` // Has many ModelPublicMealPlans
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ type ModelPublicThoughts struct {
|
||||
Content resolvespec_common.SqlString `bun:"content,type:text,notnull," json:"content"`
|
||||
CreatedAt resolvespec_common.SqlTimeStamp `bun:"created_at,type:timestamptz,default:now(),nullzero," json:"created_at"`
|
||||
GUID resolvespec_common.SqlUUID `bun:"guid,type:uuid,default:gen_random_uuid(),notnull," json:"guid"`
|
||||
Metadata resolvespec_common.SqlJSONB `bun:"metadata,type:jsonb,default:'{}::jsonb',nullzero," json:"metadata"`
|
||||
Metadata resolvespec_common.SqlJSONB `bun:"metadata,type:jsonb,default:{}::jsonb,nullzero," json:"metadata"`
|
||||
ProjectID resolvespec_common.SqlUUID `bun:"project_id,type:uuid,nullzero," json:"project_id"`
|
||||
UpdatedAt resolvespec_common.SqlTimeStamp `bun:"updated_at,type:timestamptz,default:now(),nullzero," json:"updated_at"`
|
||||
RelProjectID *ModelPublicProjects `bun:"rel:has-one,join:project_id=guid" json:"relprojectid,omitempty"` // Has one ModelPublicProjects
|
||||
|
||||
@@ -119,7 +119,7 @@ CREATE TABLE IF NOT EXISTS public.important_dates (
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
notes text,
|
||||
recurring_yearly boolean NOT NULL DEFAULT false,
|
||||
reminder_days_before integer NOT NULL DEFAULT '7',
|
||||
reminder_days_before integer NOT NULL DEFAULT 7,
|
||||
title text NOT NULL
|
||||
);
|
||||
|
||||
@@ -129,7 +129,7 @@ CREATE TABLE IF NOT EXISTS public.thoughts (
|
||||
created_at timestamptz DEFAULT now(),
|
||||
guid uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
id bigserial NOT NULL,
|
||||
metadata jsonb DEFAULT '''{}''::jsonb',
|
||||
metadata jsonb DEFAULT '{}'::jsonb,
|
||||
project_id uuid,
|
||||
updated_at timestamptz DEFAULT now()
|
||||
);
|
||||
@@ -174,7 +174,7 @@ CREATE TABLE IF NOT EXISTS public.professional_contacts (
|
||||
name text NOT NULL,
|
||||
notes text,
|
||||
phone text,
|
||||
tags text[] NOT NULL DEFAULT '''{}''',
|
||||
tags text[] NOT NULL DEFAULT '{}',
|
||||
title text,
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
@@ -222,7 +222,7 @@ CREATE TABLE IF NOT EXISTS public.stored_files (
|
||||
CREATE TABLE IF NOT EXISTS public.household_items (
|
||||
category text,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
details jsonb NOT NULL DEFAULT '''{}''',
|
||||
details jsonb NOT NULL DEFAULT '{}',
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
location text,
|
||||
name text NOT NULL,
|
||||
@@ -271,14 +271,14 @@ CREATE TABLE IF NOT EXISTS public.recipes (
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
cuisine text,
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
ingredients jsonb NOT NULL DEFAULT '''[]''',
|
||||
instructions jsonb NOT NULL DEFAULT '''[]''',
|
||||
ingredients jsonb NOT NULL DEFAULT '[]',
|
||||
instructions jsonb NOT NULL DEFAULT '[]',
|
||||
name text NOT NULL,
|
||||
notes text,
|
||||
prep_time_minutes integer,
|
||||
rating integer,
|
||||
servings integer,
|
||||
tags text[] NOT NULL DEFAULT '''{}''',
|
||||
tags text[] NOT NULL DEFAULT '{}',
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
@@ -297,7 +297,7 @@ CREATE TABLE IF NOT EXISTS public.meal_plans (
|
||||
CREATE TABLE IF NOT EXISTS public.shopping_lists (
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
items jsonb NOT NULL DEFAULT '''[]''',
|
||||
items jsonb NOT NULL DEFAULT '[]',
|
||||
notes text,
|
||||
updated_at timestamptz NOT NULL DEFAULT now(),
|
||||
week_start date NOT NULL
|
||||
@@ -308,8 +308,8 @@ CREATE TABLE IF NOT EXISTS public.chat_histories (
|
||||
channel text,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
messages jsonb NOT NULL DEFAULT '''[]''',
|
||||
metadata jsonb NOT NULL DEFAULT '''{}''',
|
||||
messages jsonb NOT NULL DEFAULT '[]',
|
||||
metadata jsonb NOT NULL DEFAULT '{}',
|
||||
project_id uuid,
|
||||
session_id text NOT NULL,
|
||||
summary text,
|
||||
@@ -345,7 +345,7 @@ CREATE TABLE IF NOT EXISTS public.learnings (
|
||||
status text NOT NULL DEFAULT 'pending',
|
||||
summary text NOT NULL,
|
||||
supersedes_learning_id uuid,
|
||||
tags text[] NOT NULL DEFAULT '''{}''',
|
||||
tags text[] NOT NULL DEFAULT '{}',
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
@@ -362,7 +362,7 @@ CREATE TABLE IF NOT EXISTS public.plans (
|
||||
reviewed_by text,
|
||||
status text NOT NULL DEFAULT 'draft',
|
||||
supersedes_plan_id uuid,
|
||||
tags text[] NOT NULL DEFAULT '''{}''',
|
||||
tags text[] NOT NULL DEFAULT '{}',
|
||||
title text NOT NULL,
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
@@ -401,7 +401,7 @@ CREATE TABLE IF NOT EXISTS public.agent_skills (
|
||||
description text NOT NULL DEFAULT '',
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
name text NOT NULL,
|
||||
tags text[] NOT NULL DEFAULT '''{}''',
|
||||
tags text[] NOT NULL DEFAULT '{}',
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
@@ -412,7 +412,7 @@ CREATE TABLE IF NOT EXISTS public.agent_guardrails (
|
||||
id uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
name text NOT NULL,
|
||||
severity text NOT NULL DEFAULT 'medium',
|
||||
tags text[] NOT NULL DEFAULT '''{}''',
|
||||
tags text[] NOT NULL DEFAULT '{}',
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
@@ -751,7 +751,7 @@ BEGIN
|
||||
AND table_name = 'important_dates'
|
||||
AND column_name = 'reminder_days_before'
|
||||
) THEN
|
||||
ALTER TABLE public.important_dates ADD COLUMN reminder_days_before integer NOT NULL DEFAULT '7';
|
||||
ALTER TABLE public.important_dates ADD COLUMN reminder_days_before integer NOT NULL DEFAULT 7;
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -842,7 +842,7 @@ BEGIN
|
||||
AND table_name = 'thoughts'
|
||||
AND column_name = 'metadata'
|
||||
) THEN
|
||||
ALTER TABLE public.thoughts ADD COLUMN metadata jsonb DEFAULT '''{}''::jsonb';
|
||||
ALTER TABLE public.thoughts ADD COLUMN metadata jsonb DEFAULT '{}'::jsonb;
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -1271,7 +1271,7 @@ BEGIN
|
||||
AND table_name = 'professional_contacts'
|
||||
AND column_name = 'tags'
|
||||
) THEN
|
||||
ALTER TABLE public.professional_contacts ADD COLUMN tags text[] NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.professional_contacts ADD COLUMN tags text[] NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -1739,7 +1739,7 @@ BEGIN
|
||||
AND table_name = 'household_items'
|
||||
AND column_name = 'details'
|
||||
) THEN
|
||||
ALTER TABLE public.household_items ADD COLUMN details jsonb NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.household_items ADD COLUMN details jsonb NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -2220,7 +2220,7 @@ BEGIN
|
||||
AND table_name = 'recipes'
|
||||
AND column_name = 'ingredients'
|
||||
) THEN
|
||||
ALTER TABLE public.recipes ADD COLUMN ingredients jsonb NOT NULL DEFAULT '''[]''';
|
||||
ALTER TABLE public.recipes ADD COLUMN ingredients jsonb NOT NULL DEFAULT '[]';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -2233,7 +2233,7 @@ BEGIN
|
||||
AND table_name = 'recipes'
|
||||
AND column_name = 'instructions'
|
||||
) THEN
|
||||
ALTER TABLE public.recipes ADD COLUMN instructions jsonb NOT NULL DEFAULT '''[]''';
|
||||
ALTER TABLE public.recipes ADD COLUMN instructions jsonb NOT NULL DEFAULT '[]';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -2311,7 +2311,7 @@ BEGIN
|
||||
AND table_name = 'recipes'
|
||||
AND column_name = 'tags'
|
||||
) THEN
|
||||
ALTER TABLE public.recipes ADD COLUMN tags text[] NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.recipes ADD COLUMN tags text[] NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -2480,7 +2480,7 @@ BEGIN
|
||||
AND table_name = 'shopping_lists'
|
||||
AND column_name = 'items'
|
||||
) THEN
|
||||
ALTER TABLE public.shopping_lists ADD COLUMN items jsonb NOT NULL DEFAULT '''[]''';
|
||||
ALTER TABLE public.shopping_lists ADD COLUMN items jsonb NOT NULL DEFAULT '[]';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -2584,7 +2584,7 @@ BEGIN
|
||||
AND table_name = 'chat_histories'
|
||||
AND column_name = 'messages'
|
||||
) THEN
|
||||
ALTER TABLE public.chat_histories ADD COLUMN messages jsonb NOT NULL DEFAULT '''[]''';
|
||||
ALTER TABLE public.chat_histories ADD COLUMN messages jsonb NOT NULL DEFAULT '[]';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -2597,7 +2597,7 @@ BEGIN
|
||||
AND table_name = 'chat_histories'
|
||||
AND column_name = 'metadata'
|
||||
) THEN
|
||||
ALTER TABLE public.chat_histories ADD COLUMN metadata jsonb NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.chat_histories ADD COLUMN metadata jsonb NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -2987,7 +2987,7 @@ BEGIN
|
||||
AND table_name = 'learnings'
|
||||
AND column_name = 'tags'
|
||||
) THEN
|
||||
ALTER TABLE public.learnings ADD COLUMN tags text[] NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.learnings ADD COLUMN tags text[] NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -3169,7 +3169,7 @@ BEGIN
|
||||
AND table_name = 'plans'
|
||||
AND column_name = 'tags'
|
||||
) THEN
|
||||
ALTER TABLE public.plans ADD COLUMN tags text[] NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.plans ADD COLUMN tags text[] NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -3481,7 +3481,7 @@ BEGIN
|
||||
AND table_name = 'agent_skills'
|
||||
AND column_name = 'tags'
|
||||
) THEN
|
||||
ALTER TABLE public.agent_skills ADD COLUMN tags text[] NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.agent_skills ADD COLUMN tags text[] NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -3585,7 +3585,7 @@ BEGIN
|
||||
AND table_name = 'agent_guardrails'
|
||||
AND column_name = 'tags'
|
||||
) THEN
|
||||
ALTER TABLE public.agent_guardrails ADD COLUMN tags text[] NOT NULL DEFAULT '''{}''';
|
||||
ALTER TABLE public.agent_guardrails ADD COLUMN tags text[] NOT NULL DEFAULT '{}';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
@@ -4574,7 +4574,7 @@ CREATE INDEX IF NOT EXISTS idx_learnings_tags
|
||||
ON public.learnings USING gin (tags gin_trgm_ops);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_plans_tags
|
||||
ON public.plans USING gin (tags gin_trgm_ops);
|
||||
ON public.plans USING gin (tags);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_plans_title
|
||||
ON public.plans USING gin (title gin_trgm_ops);
|
||||
|
||||
Reference in New Issue
Block a user