From d4a6832ff8f2573fcdb4c74b49bf5b8a3c164f25 Mon Sep 17 00:00:00 2001 From: Partow Roshani Date: Wed, 13 Aug 2025 20:18:14 +0330 Subject: [PATCH] Update init.sql --- src/main/resources/init.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/resources/init.sql b/src/main/resources/init.sql index e5b9720..5325bc0 100644 --- a/src/main/resources/init.sql +++ b/src/main/resources/init.sql @@ -156,5 +156,14 @@ CREATE TABLE IF NOT EXISTS message_attachments ( ); +--Run this part in your pg +ALTER TABLE message_attachments + ADD COLUMN IF NOT EXISTS media_key UUID; +CREATE EXTENSION IF NOT EXISTS pgcrypto; + +UPDATE message_attachments +SET media_key = gen_random_uuid() +WHERE media_key IS NULL; +