Skip to content

Commit

Permalink
fixup! chore: add migration
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <[email protected]>
  • Loading branch information
SdgJlbl committed Dec 14, 2023
1 parent a3626c6 commit b702c7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/standalone/migration/000060_add_function_image.up.sql
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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');

0 comments on commit b702c7a

Please sign in to comment.