Refactor to prepare for seed export. It now uses a template to render
the migration.