Fix positions table

This PR adds a check to avoid updating positions table after first phase. It also adds a method for table regeneration. It will run in the console.
Wouldn't it be better to have this as a rake task? The logic is good, but I'm not convinced with having it as a class method.
This is something we should do only once or after some specific situation.
Just an idea.