entity structure and db script