Define database model

Close #1