fixed profile preferences
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
-- Store profile preferences as JSON text instead of text[].
|
||||
-- Safe when the column is already text (no-op cast).
|
||||
|
||||
alter table public.profiles
|
||||
alter column focus_topics drop default;
|
||||
|
||||
alter table public.profiles
|
||||
alter column focus_topics type text using (
|
||||
case
|
||||
when focus_topics is null then null
|
||||
when pg_typeof(focus_topics)::text = 'text[]' then
|
||||
case
|
||||
when coalesce(array_length(focus_topics::text[], 1), 0) = 0 then null
|
||||
else (focus_topics::text[])[1]
|
||||
end
|
||||
else focus_topics::text
|
||||
end
|
||||
);
|
||||
|
||||
alter table public.profiles
|
||||
alter column focus_topics set default null;
|
||||
Reference in New Issue
Block a user