Skip to content

Instantly share code, notes, and snippets.

@mklooss
Last active October 18, 2018 08:00
Show Gist options
  • Save mklooss/be22770d98ba512b02da to your computer and use it in GitHub Desktop.
Save mklooss/be22770d98ba512b02da to your computer and use it in GitHub Desktop.
remove some Magento Data for Development Systems
--
-- Remove Orders
--
DELETE FROM sales_flat_order;
DELETE FROM sales_flat_creditmemo_comment;
DELETE FROM sales_flat_creditmemo_item;
DELETE FROM sales_flat_creditmemo;
DELETE FROM sales_flat_creditmemo_grid;
DELETE FROM sales_flat_invoice_comment;
DELETE FROM sales_flat_invoice_item;
DELETE FROM sales_flat_invoice;
DELETE FROM sales_flat_invoice_grid;
DELETE FROM sales_flat_quote;
DELETE FROM sales_flat_quote_address_item;
DELETE FROM sales_flat_quote_item_option;
DELETE FROM sales_flat_quote_address;
DELETE FROM sales_flat_quote_item;
DELETE FROM sales_flat_quote_payment;
DELETE FROM sales_flat_shipment_comment;
DELETE FROM sales_flat_shipment_item;
DELETE FROM sales_flat_shipment_track;
DELETE FROM sales_flat_shipment;
DELETE FROM sales_flat_shipment_grid;
DELETE FROM sales_flat_order_address;
DELETE FROM sales_flat_order_item;
DELETE FROM sales_flat_order_payment;
DELETE FROM sales_flat_order_status_history;
DELETE FROM sales_flat_order_grid;
DELETE FROM log_quote;
DELETE FROM sales_order_tax;
DELETE FROM sales_invoiced_aggregated;
DELETE FROM sales_invoiced_aggregated_order;
DELETE FROM sales_order_aggregated_created;
DELETE FROM sales_order_aggregated_updated;
DELETE FROM sales_refunded_aggregated;
DELETE FROM sales_refunded_aggregated_order;
DELETE FROM sales_shipping_aggregated;
DELETE FROM sales_shipping_aggregated_order;
DELETE FROM coupon_aggregated;
DELETE FROM coupon_aggregated_order;
DELETE FROM tax_order_aggregated_created;
DELETE FROM tax_order_aggregated_updated;
--
-- Remover Customers
--
DELETE FROM customer_entity;
DELETE FROM customer_address_entity;
DELETE FROM wishlist;
DELETE FROM wishlist_item;
DELETE FROM wishlist_item_option;
--
-- Remove Log
--
DELETE FROM log_customer;
DELETE FROM log_quote;
DELETE FROM log_summary;
DELETE FROM log_url;
DELETE FROM log_url_info;
DELETE FROM log_visitor;
DELETE FROM log_visitor_info;
DELETE FROM log_visitor_online;
DELETE FROM index_event;
DELETE FROM index_process_event;
--
-- Remove Reports
--
DELETE FROM sales_bestsellers_aggregated_daily;
DELETE FROM sales_bestsellers_aggregated_monthly;
DELETE FROM sales_bestsellers_aggregated_yearly;
DELETE FROM sales_bestsellers_aggregated_daily;
DELETE FROM sales_bestsellers_aggregated_daily;
DELETE FROM catalogsearch_query;
DELETE FROM report_event;
DELETE FROM report_viewed_product_index;
DELETE FROM newsletter_subscriber;
--
-- Core
--
DELETE FROM cron_schedule;
--
-- Tags / Poll
--
DELETE FROM tag_summary;
DELETE FROM tag_relation;
DELETE FROM tag;
DELETE FROM poll_answer;
--
-- Remove some Data from core_url_rewrite
--
DELETE FROM core_url_rewrite WHERE options = 'RP';
DELETE FROM core_url_rewrite WHERE category_id IS NOT NULL AND product_id IS NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment