From b702c7a22aa41419e9340a0284a269f7dd46f4c9 Mon Sep 17 00:00:00 2001 From: SdgJlbl Date: Thu, 14 Dec 2023 14:56:57 +0100 Subject: [PATCH] fixup! chore: add migration Signed-off-by: SdgJlbl --- server/standalone/migration/000060_add_function_image.up.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/standalone/migration/000060_add_function_image.up.sql b/server/standalone/migration/000060_add_function_image.up.sql index ebb37fd7..e23a11d8 100644 --- a/server/standalone/migration/000060_add_function_image.up.sql +++ b/server/standalone/migration/000060_add_function_image.up.sql @@ -1,6 +1,6 @@ SELECT execute($$ ALTER TABLE functions - ADD COLUMN image_address VARCHAR(200) NULL; + ADD COLUMN image_address VARCHAR(200) DEFAULT "" NOT NULL; ALTER TABLE functions RENAME COLUMN functionAddress to archive_address; @@ -31,7 +31,7 @@ SELECT execute($$ WHERE asset_kind = 'ASSET_FUNCTION' AND NOT(asset ? 'archiveAddress'); UPDATE events - SET asset = asset - imageAddress + SET asset = jsonb_set(asset, '{imageAddress}', null) WHERE asset_kind = 'ASSET_FUNCTION' AND NOT(asset ? 'imageAddress'); $$) WHERE NOT column_exists('public', 'functions', 'image_address');