only dump schema information if migration table exists. Closes #14217

Conflicts:

	activerecord/CHANGELOG.md