Add DB Scripts and ER-model
Fix some bugs #1