jorge-menjivar / unsaged

Open source chat kit engineered for seamless interaction with AI models.

Home Page:https://unsaged.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] DB Migration - jsonb NOT NULL DEFAULT

daniel-farina opened this issue · comments

Describe the bug
When running the migration script (Generation Script) on supabase I'm seeing this error:

ERROR:  42601: syntax error at or near "NOT"
LINE 121: 	jsonb NOT NULL DEFAULT '{}'::jsonb,

I'll try to figure it out in the meantime.

Ok the issue is we are using jsonb as a column name which reserved. Introduced here: 57d6632#diff-d16041045cc166cccbdd297949ea7426968669c6e2867bd16a662b392f3acdfbR119

I changed the name to something and it worked but of course this would need some refactoring.

Ok after looking at your upgrade script:

ALTER TABLE public.conversations ADD params jsonb NOT NULL DEFAULT '{}'::jsonb;

it seems jsonb NOT NULL DEFAULT '{}'::jsonb, is missing params so it should be:

params jsonb NOT NULL DEFAULT '{}'::jsonb,

I submitted a PR with the fix. Cheers.