diff --git a/sql/grantprograms_uninstall.sql b/sql/grantprograms_uninstall.sql index e4a43d1441c12de7379ba8725b5e365bbb927033..f07c33fc1b46da973906e3a351210c92520949a8 100755 --- a/sql/grantprograms_uninstall.sql +++ b/sql/grantprograms_uninstall.sql @@ -37,14 +37,6 @@ LEFT JOIN civicrm_entity_financial_trxn ceft1 ON cft.id = ceft1.financial_trxn_i LEFT JOIN civicrm_financial_item ci ON ci.id = ceft1.entity_id WHERE ceft.entity_table = 'civicrm_grant'; -SELECT @financialType := id FROM civicrm_financial_type WHERE name = 'NEI Grant'; - -DELETE FROM civicrm_entity_financial_account WHERE entity_table = 'civicrm_financial_type' AND entity_id = @financialType; - -DELETE FROM civicrm_financial_account WHERE name = 'NEI Grant'; - -DELETE FROM civicrm_financial_type WHERE name = 'NEI Grant'; - -- RG-149 DELETE cg, cv FROM civicrm_option_group cg INNER JOIN civicrm_option_value cv ON cg.id = cv.option_group_id @@ -131,4 +123,12 @@ DELETE FROM civicrm_msg_template WHERE msg_title = 'Grants Approved for Payment DELETE FROM civicrm_msg_template WHERE msg_title = 'Grants Submitted Receipt'; DELETE FROM civicrm_msg_template WHERE msg_title = 'Grants Withdrawn Receipt'; DELETE FROM civicrm_msg_template WHERE msg_title = 'Grant Payment Check'; -DELETE FROM civicrm_msg_template WHERE msg_title = 'Grant Payment Report'; \ No newline at end of file +DELETE FROM civicrm_msg_template WHERE msg_title = 'Grant Payment Report'; + +SELECT @financialType := id FROM civicrm_financial_type WHERE name = 'NEI Grant'; + +DELETE FROM civicrm_entity_financial_account WHERE entity_table = 'civicrm_financial_type' AND entity_id = @financialType; + +DELETE FROM civicrm_financial_account WHERE name = 'NEI Grant'; + +DELETE FROM civicrm_financial_type WHERE name = 'NEI Grant';