Automatically create the database on startup

Same as the corresponding PR for the posts template