Dundee United left-back Barry Douglas has signed a two-year contract with Lech Poznan after passing a medical with the Polish side.