Unit tests for v2 DB model

Change-Id: I11dab20c14217123489015293ed094e954320f9a