Created
November 3, 2017 10:29
-
-
Save joostvanveen/f2539dea22f56b6ea156571a28085977 to your computer and use it in GitHub Desktop.
Truncate all customers and their reviews from Magento 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS = 0; | |
-- TRUNCATE CUSTOMERS | |
TRUNCATE TABLE `PREFIX_customer_address_entity`; | |
TRUNCATE TABLE `PREFIX_customer_address_entity_datetime`; | |
TRUNCATE TABLE `PREFIX_customer_address_entity_decimal`; | |
TRUNCATE TABLE `PREFIX_customer_address_entity_int`; | |
TRUNCATE TABLE `PREFIX_customer_address_entity_text`; | |
TRUNCATE TABLE `PREFIX_customer_address_entity_varchar`; | |
TRUNCATE TABLE `PREFIX_customer_entity`; | |
TRUNCATE TABLE `PREFIX_customer_entity_datetime`; | |
TRUNCATE TABLE `PREFIX_customer_entity_decimal`; | |
TRUNCATE TABLE `PREFIX_customer_entity_int`; | |
TRUNCATE TABLE `PREFIX_customer_entity_text`; | |
TRUNCATE TABLE `PREFIX_customer_entity_varchar`; | |
TRUNCATE TABLE `PREFIX_customer_grid_flat`; | |
TRUNCATE TABLE `PREFIX_customer_log`; | |
TRUNCATE TABLE `PREFIX_customer_log`; | |
TRUNCATE TABLE `PREFIX_customer_visitor`; | |
TRUNCATE TABLE `PREFIX_persistent_session`; | |
TRUNCATE TABLE `PREFIX_wishlist`; | |
TRUNCATE TABLE `PREFIX_wishlist_item`; | |
TRUNCATE TABLE `PREFIX_wishlist_item_option`; | |
-- TRUNCATE REVIEWS | |
TRUNCATE TABLE `PREFIX_review`; | |
TRUNCATE TABLE `PREFIX_review_detail`; | |
TRUNCATE TABLE `PREFIX_review_entity_summary`; | |
TRUNCATE TABLE `PREFIX_review_store`; | |
SET FOREIGN_KEY_CHECKS = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment