There were certain queries which did not filter
by the current schema, but hardcoded public schema.
Apart from that, we always filter with the current schema
which allows connection proxies to run multiple MM within
a single DB.
```release-note
NONE
```
* migrations: add if statements for some queries
* add better checks to upgrade posts v6 migration
* use "is null" instead of "= null"
* fix down script for users v6
* reflect review comments