Add migrations and fixed user repository