patches merged, Variant entity structure added, ddl updated