Revert "Migrate modules to new db"

This reverts commit f263963f86ef22f5fff29a594e0a626d6fc31e0c.
Use right stacklevel for deprecation warning
Revert "[db] Fix an injection issue in update"

This reverts commit d24db3cb31acfb26b2a9a3f80f89b6648cbcc2bd.
[db] Actually fix that injection issue

Thank fuck this commit isn't going to have to be maintained long-term,
because it's a half-assed hack done at the last minute. As opposed to
the shit it's patching, which doesn't rise to the level of half-assed
hackery.