Primitive db done. Join many-to-many version applied.