How to create a new user in pure sql

I wouldn’t advise using the md5 hash as a password, it will be used as the actual password. If you won’t be needing the password field upon user creation, just use a long random string instead.

What I was trying to say is that Discourse will first try to log in the user by matching the password entered by the user with the stored password. Only when that attempt fails, the migratepassword plugin will come into play, and it will try to see if the user supplied password is correct by matching it against the custom field using a number of built-in alternative hashing algorithms (md5 being one of them).