Issues in Like Count for OSQA Migration to Discourse

I recently did a likes-import directly in SQL, and updated counts successfully. If you want, I can share queries here, but since it’s a “worst-practice” doing it through the database, it didn’t think of sharing it with the Community. I will, if there is interest.

A trick that is useful even if you’re writing a proper Ruby importer is to run the server with a command like this

bundle exec rails server --binding=0.0.0.0 | grep -i 'update\|insert'

And then try the action (in this case, the “Like”) from the UI. You will see the SQL that Discourse is using to change tables. This will help you figure out the several things involved in the action.