Update links to n8n server

This commit is contained in:
Maikel Linke
2024-05-02 15:55:16 +10:00
parent 2e004a026b
commit b0a89372ab
2 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
# We got a new n8n server.
# But we still have some database rows with a URL to the old server.
class UpdateN8nUrl < ActiveRecord::Migration[7.0]
def up
execute <<~SQL.squish
UPDATE connected_apps
SET data = replace(
data::text,
'n8n.openfoodnetwork.org.uk',
'n8n.openfoodnetwork.org'
)::jsonb
WHERE data IS NOT NULL;
SQL
end
end