1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Repo.Migrations.ChangeChatIdToFlake do
11 drop constraint chats_pkey cascade,
12 alter column id drop default,
13 alter column id set data type uuid using cast( lpad( to_hex(id), 32, '0') as uuid),
18 alter table chat_message_references
19 alter column chat_id set data type uuid using cast( lpad( to_hex(chat_id), 32, '0') as uuid),
20 add constraint chat_message_references_chat_id_fkey foreign key (chat_id) references chats(id) on delete cascade