Script for building the database