Move logs table migration to testing logic

Since the `logs` table migration should not happen in production,
move it to a place migration does not search, and add a testing
step to set up the table correction for the tests.