Skip to content

Instantly share code, notes, and snippets.

@chesster
Created January 8, 2015 11:22
Show Gist options
  • Save chesster/efa693ebc99b0a60e23f to your computer and use it in GitHub Desktop.
Save chesster/efa693ebc99b0a60e23f to your computer and use it in GitHub Desktop.
select @user_id:=id from RABC_users where email="[email protected]";
-- delete from `users_inactive` where `email` in (@email);
delete from `progress` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `progress_meals` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `progress_nutrients` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `progress_optional` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `progress_reason` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `progress_training` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_caloriebudgets` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_intake` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_meal_suggestions` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_meal_suggestions_fruits` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_meal_suggestions_recipes` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_meal_suggestions_supplement` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_measurements` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `subscriptions_week_plan` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `users_subscriptions_payments` where `subscription_id` in (select id from `users_subscriptions` where `user_id` in (@user_id));
delete from `RABC_cookies` where `user_id`=@user_id;
delete from `RABC_password_reset` where `user_id`=@user_id;
delete from `RABC_users_roles` where `user_id`=@user_id;
delete from `RABC_verification` where `user_id`=@user_id;
delete from `api_usage` where `user_id`=@user_id;
delete from `community_forum_notifications` where `user_id`=@user_id;
delete from `community_forum_posts` where `user_id`=@user_id;
delete from `community_forum_posts_violations` where `user_id`=@user_id;
delete from `community_forum_threads` where `user_id`=@user_id;
delete from `community_recipes` where `user_id`=@user_id;
delete from `messages` where `from`=@user_id or `to`=@user_id;
delete from `oauth_access_tokens` where `user_id`=@user_id;
delete from `oauth_auth_codes` where `user_id`=@user_id;
delete from `oauth_refresh_tokens` where `user_id`=@user_id;
delete from `users_clients` where `user_id`=@user_id;
-- delete from `oauth_clients` where `client_id` in (@client_id);
delete from `users_coaches` where `user_id`=@user_id;
delete from `users_extra_questions` where `user_id`=@user_id;
delete from `users_favorite_meals` where `user_id`=@user_id;
delete from `users_ideal_transactions` where `user_id`=@user_id;
delete from `users_pending_coupons` where `user_id`=@user_id;
delete from `users_registered_via` where `user_id`=@user_id;
delete from `users_reserved_coupons` where `user_id`=@user_id;
delete from `users_reserved_credits` where `user_id`=@user_id;
delete from `users_subscriptions` where `user_id`=@user_id;
delete from `users_used_coupons` where `user_id`=@user_id;
delete from `users_used_credits` where `user_id`=@user_id;
delete from `RABC_users` where `id`=@user_id;
delete from `users` where `user_id`=@user_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment