Fix migration DB func