fix migration if tables exist like on we.r.n
make migration pure sql so it's faster