From 403c4f8b46d17869eb3ca18c8b6a3950e8b25c92 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 4 Apr 2017 14:32:26 +1000 Subject: [PATCH] Move upgrade logic to .19 --- CRM/Upgrade/Incremental/sql/4.7.16.mysql.tpl | 13 ------------- CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CRM/Upgrade/Incremental/sql/4.7.16.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.16.mysql.tpl index dcc26eaf7c..54ab063979 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.16.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.16.mysql.tpl @@ -26,16 +26,3 @@ UPDATE `civicrm_dashboard` SET name = CONCAT('report/', SUBSTRING_INDEX(SUBSTRING_INDEX(url, '?', 1), '/', -1)) WHERE name IS NULL AND url LIKE "civicrm/report/instance/%"; --- CRM-19517 Disable all price fields and price field options that use disabled fianancial types -UPDATE civicrm_price_field_value cpfv -INNER JOIN civicrm_financial_type cft ON cft.id = cpfv.financial_type_id -SET cpfv.is_active = 0 -WHERE cft.is_active = 0; - -UPDATE civicrm_price_field cpf -LEFT JOIN (SELECT DISTINCT price_field_id AS price_field_id - FROM civicrm_price_field_value - WHERE is_active = 1) AS price_field -ON price_field.price_field_id = cpf.id -SET cpf.is_active = 0 -WHERE price_field.price_field_id IS NULL; diff --git a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl index d6cecd7134..0b12d05bdc 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl @@ -7,3 +7,18 @@ SELECT @close_accounting_period_activity_count := count(id) FROM `civicrm_activi -- Delete Close Accounting Period activity type DELETE FROM civicrm_option_value WHERE option_group_id = @option_group_id_act AND name = 'Close Accounting Period' AND @close_accounting_period_activity_count = 0; + +-- CRM-19517 Disable all price fields and price field options that use disabled fianancial types +UPDATE civicrm_price_field_value cpfv +INNER JOIN civicrm_financial_type cft ON cft.id = cpfv.financial_type_id +SET cpfv.is_active = 0 +WHERE cft.is_active = 0; + +UPDATE civicrm_price_field cpf +LEFT JOIN (SELECT DISTINCT price_field_id AS price_field_id + FROM civicrm_price_field_value + WHERE is_active = 1) AS price_field +ON price_field.price_field_id = cpf.id +SET cpf.is_active = 0 +WHERE price_field.price_field_id IS NULL; + -- 2.25.1