Closed ansonphong closed 11 years ago
I'm wondering why was author_id column removed from wp_postworld_post_meta .I think it should be added to this table instead of wp_postworld_post_points as we agreed in a previous e-mail. Let me know if you want me to change it.
This is an interesting idea. Do you think that joining the table with wp_posts in the query will have significant change of performance?
It would be redundant data, but if it helps performance significantly then its a good idea.
If we re-add author id to the table, we'll also want to add a function in pw_update/insert_post which keeps the value updated, as there is an option for admins to change the author of a post after it's created.
What do you think?
On Saturday, November 2, 2013, hmikhail wrote:
I'm wondering why was author_id column removed from wp_postworld_post_meta .I think it should be added to this table instead of wp_postworld_post_points as we agreed in a previous e-mail. Let me know if you want me to change it.
— Reply to this email directly or view it on GitHubhttps://github.com/phongmedia/postworld/issues/72#issuecomment-27629447 .
I think this is better than doing the join. And adding author_id to post_meta is less redundant than adding it to post_points. I can add the change to update/insert post easily as it was partially implemented in the old code.
Right I understand.
Yes you can go ahead and update the schema as you suggested, and have a review of the other functions to see if anything else would be affected.
Thanks
On Saturday, November 2, 2013, hmikhail wrote:
I think this is better than doing the join. And adding author_id to post_meta is less redundant than adding it to post_points. I can add the change to update/insert post easily as it was partially implemented in the old code.
— Reply to this email directly or view it on GitHubhttps://github.com/phongmedia/postworld/issues/72#issuecomment-27631761 .
Hi Haidy, I found a small bug which makes the in the points functions not work. This is due to a schema change that happened several weeks ago, where we removed author_id which was redundant in
wp_postworld_post_meta
.As a result these errors were found.
On
calculate_user_post_points()
, this error is produced:On
get_user_points_voted_to_posts()
this error is produced: