create database and set foreign keys. ready model of dataBase