Skip to content

Commit

Permalink
Merge pull request #1 from sitewards/adhoc-fix-config-value-update
Browse files Browse the repository at this point in the history
ADHOC-FIX (update config values) Change behavior to insert or update
  • Loading branch information
toxix authored Mar 28, 2019
2 parents 37f8691 + 9b8caf1 commit 44c3079
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tasks/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,16 @@
shell:
cmd: |
mysql --user="{{ magento_config_db.username }}" --password="{{ magento_config_db.password }}" --database="{{ magento_config_db.name }}" --host="{{ magento_config_db.host }}" <<EOF
UPDATE core_config_data
SET value = '{{ item.value | regex_replace('\[\[', '{{') | regex_replace('\]\]', '}}') }}'
WHERE path = '{{ item.path }}' AND
scope = '{{ item.scope }}' AND
scope_id = {{ item.scope_id }};
INSERT INTO core_config_data (path, scope, scope_id, value)
VALUES (
'{{ item.path }}',
'{{ item.scope }}',
{{ item.scope_id }},
'{{ item.value | regex_replace('\[\[', '{{') | regex_replace('\]\]', '}}') }}'
)
ON DUPLICATE KEY UPDATE
value = '{{ item.value | regex_replace('\[\[', '{{') | regex_replace('\]\]', '}}') }}'
;
EOF
with_items: "{{ magento_core_config_data }}"

Expand Down

0 comments on commit 44c3079

Please sign in to comment.