Check tables exist before creating

Props @ericjuden