Last active
August 29, 2015 14:06
-
-
Save strangerstudios/4604f62e9812cf3afde7 to your computer and use it in GitHub Desktop.
Update the startdate column for PMPro members to match their user_registered date if their startdate is empty.
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
# If users were imported without a membership_startdate set or | |
# otherwise don't have a startdate value in the wp_pmpro_memberships_users | |
# table, this query will set their startdate to the date they registered. | |
# NOTE: You should change the table names to match your own prefixes. | |
UPDATE wp_pmpro_memberships_users mu | |
LEFT JOIN wp_users u ON mu.user_id = u.ID | |
SET mu.startdate = u.user_registered | |
WHERE mu.startdate IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment