Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code_id and user_id in a separate db table #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

heddesheimer
Copy link

I have changed the plugin to store the relation of user_id and code_id in a separate table instead of using one entry in the options table. This should scale much better if you expect several hundred users, who are using the sponsored membership.

I did not succeed using the dbDelta() function to create the table, so I used a simple $wdpb->query() instead. Also, there is no conversion to import the old option setting into the table (yet). So there should be a warning for users who want to update from an older version (or there should be an import function).

First version for the coupon table.
Cleaned up old comments.
Old data will now be inserted into the new table, when upgrading from
the former version.
@heddesheimer
Copy link
Author

Just a quick heads up: I have added the update functionality, so that the numbers from the option table will be inserted in the new db table, when it's created for the first time.

I did not have time to do extensive tests, but it's pretty straightforward, so I don't expect any problems.

@strangerstudios
Copy link
Collaborator

Just a note that we're releasing an updated version of the plugin, but I hope to incorporate something like this in the addon soon after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants