mirror of
https://github.com/willchen96/mike.git
synced 2026-07-24 23:41:04 +02:00
19 lines
475 B
SQL
19 lines
475 B
SQL
do $$
|
|
begin
|
|
if exists (
|
|
select 1
|
|
from information_schema.columns
|
|
where table_schema = 'public'
|
|
and table_name = 'chat_messages'
|
|
and column_name = 'annotations'
|
|
) and not exists (
|
|
select 1
|
|
from information_schema.columns
|
|
where table_schema = 'public'
|
|
and table_name = 'chat_messages'
|
|
and column_name = 'citations'
|
|
) then
|
|
alter table public.chat_messages
|
|
rename column annotations to citations;
|
|
end if;
|
|
end $$;
|