-- remove module tables
DROP TABLE tnw_accountingseed_sales_item_communication;
DROP TABLE tnw_quote_mapping_quote_status;
DROP TABLE tnw_salesforce_account_matching;
DROP TABLE tnw_salesforce_entity_cache;
DROP TABLE tnw_salesforce_imports;
DROP TABLE tnw_salesforce_log;
DROP TABLE tnw_salesforce_mapping;
DROP TABLE tnw_salesforce_order_creditmemo_status;
DROP TABLE tnw_salesforce_order_status;
DROP TABLE tnw_salesforce_queue;
DROP TABLE tnw_salesforce_queue_storage;
-- remove module attributes
DELETE FROM eav_attribute WHERE attribute_code IN ('salesforce_account_id','salesforce_account_owner_id','salesforce_campaign_id','salesforce_contact_owner_id','salesforce_disable_sync','salesforce_id','salesforce_is_person','salesforce_lead_id','salesforce_lead_owner_id','salesforce_pricebook_id', 'sf_insync');
-- remove module columns
ALTER TABLE sales_flat_creditmemo DROP salesforce_id;
ALTER TABLE sales_flat_creditmemo DROP sf_insync;
ALTER TABLE sales_flat_creditmemo DROP salesforce_account_payable_id;
ALTER TABLE sales_flat_creditmemo DROP salesforce_cash_disbursement_id;
ALTER TABLE sales_flat_creditmemo_comment DROP salesforce_id;
ALTER TABLE sales_flat_creditmemo_item DROP salesforce_inbound_inventory_movement;
ALTER TABLE sales_flat_invoice DROP salesforce_id;
ALTER TABLE sales_flat_invoice DROP sf_insync;
ALTER TABLE sales_flat_invoice DROP ac_salesforce_id;
ALTER TABLE sales_flat_invoice_comment DROP salesforce_id;
ALTER TABLE sales_flat_invoice_comment DROP ac_salesforce_id;
ALTER TABLE sales_flat_invoice_item DROP salesforce_id;
ALTER TABLE sales_flat_invoice_item DROP ac_salesforce_id;
ALTER TABLE sales_flat_order DROP salesforce_id;
ALTER TABLE sales_flat_order DROP sf_insync;
ALTER TABLE sales_flat_order DROP contact_salesforce_id;
ALTER TABLE sales_flat_order DROP account_salesforce_id;
ALTER TABLE sales_flat_order DROP opportunity_id;
ALTER TABLE sales_flat_order DROP owner_salesforce_id;
ALTER TABLE sales_flat_order_item DROP salesforce_id;
ALTER TABLE sales_flat_order_item DROP opportunity_id;
ALTER TABLE sales_flat_quote DROP salesforce_id;
ALTER TABLE sales_flat_quote DROP sf_insync;
ALTER TABLE sales_flat_quote DROP sf_sync_force;
ALTER TABLE sales_flat_quote DROP contact_salesforce_id;
ALTER TABLE sales_flat_quote DROP account_salesforce_id;
ALTER TABLE sales_flat_quote_item DROP salesforce_id;
ALTER TABLE sales_flat_shipment DROP sf_insync;
ALTER TABLE sales_flat_shipment DROP salesforce_id;
ALTER TABLE sales_flat_shipment DROP ac_salesforce_id;
ALTER TABLE sales_flat_shipment_comment DROP salesforce_id;
ALTER TABLE sales_flat_shipment_comment DROP ac_salesforce_id;
ALTER TABLE sales_flat_shipment_item DROP salesforce_id;
ALTER TABLE sales_flat_shipment_item DROP ac_salesforce_id;
ALTER TABLE salesrule DROP sf_insync;
ALTER TABLE salesrule DROP salesforce_id;
ALTER TABLE wishlist DROP sf_insync;
ALTER TABLE wishlist DROP salesforce_id;
ALTER TABLE core_website DROP salesforce_id;
ALTER TABLE core_website DROP pricebook_id;
ALTER TABLE quoteadv_customer DROP salesforce_id;
ALTER TABLE quoteadv_customer DROP sf_insync;
ALTER TABLE quoteadv_customer DROP salesforce_owner_id;
ALTER TABLE quoteadv_customer DROP salesforce_initial_owner_id;
-- remove module version from the resource table
DELETE FROM core_resource WHERE code IN ('tnw_accountingseed_setup', 'tnw_salesforce_setup', 'tnw_quote_setup');
|