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

Expired/disabled bans imported erroneously #9

Open
jim-p opened this issue May 29, 2018 · 2 comments
Open

Expired/disabled bans imported erroneously #9

jim-p opened this issue May 29, 2018 · 2 comments

Comments

@jim-p
Copy link

jim-p commented May 29, 2018

We have a rather large userbase (considering banned users, close to 300k users) that mostly imported OK from SMF but we hand a handful of users (43 users, ~0.015%) that had incorrect bans. After digging around in the old SMF ban tables we found that a few conditions which led to SMF users without an active ban ending up banned in NodeBB after import. These include:

  • Manually disabled ban entries: Items from smf_ban_groups where expire_time = 0
    select * from smf_ban_groups where expire_time = 0;
  • Bans with an expiration date, need to check if current time > expire_time, or skip import: Items from smf_ban_groups where expire_time <> 0 and expire_time is not null
    select * from smf_ban_groups where expire_time <> 0 and expire_time is not null;
  • Items from smf_ban_groups with no corresponding ban triggers in smf_ban_items (Selecting from smf_ban_items where smf_ban_items.id_ban_group = smf_ban_groups.id_ban_group ends up with an empty set)
    select * from smf_ban_groups where id_ban_group not in (select id_ban_group from smf_ban_items);
@akhoury
Copy link
Collaborator

akhoury commented May 30, 2018

it seems you're well aware of the solution, I would really appreciate a pull request 😄

@jim-p
Copy link
Author

jim-p commented May 30, 2018

Fair enough! I'd love to dig in and try that but at the moment I don't have time available to take that on. :)

Now that our import is done we likely won't need this again, but I figured it was worth noting for the next person who came along and needed it.

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

No branches or pull requests

2 participants