Added database migration for contrib.contenttypes.

Moved contenttypes tests to allow them to run correctly in the presence of
migrations. refs #22170.