Database checking and creation.