Closed ciriousjoker closed 1 year ago
So apparently these seems to work:
UPDATE files
SET formats = replace(formats::TEXT, 'https://storage.googleapis.com/CHANGETHIS/', 'https://example.com/')::jsonb;
UPDATE files
SET url = replace(url::TEXT, 'https://storage.googleapis.com/CHANGETHIS/', 'https://example.com/')::varchar(255);
Adapted from source: https://stackoverflow.com/a/71221922/5854364
Use at your own risk.
Since there exists a reasonable workaround, I'm closing this.
Describe the bug I just set a baseUrl for production. There exist many previously uploaded files (at that point, baseUrl was undefined).
To Reproduce Steps to reproduce the behavior:
Expected behavior Api returns both images as being hosted from the new baseUrl.
Actual behavior Api returns a different baseUrl for each image
Desktop (please complete the following information): N/A
Smartphone (please complete the following information): N/A
Additional context I've considered updating the sql table manually, but I'm not too familiar with sql and modifying a json string via sql sounds like a terrible idea.