Add function to create sql fields