Closed (fixed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Drush
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 May 2011 at 14:46 UTC
Updated:
1 Jun 2012 at 18:11 UTC
Inspired by #1152732: Define assertions on the data source...
It would be good to support reporting on the available data, along the lines of the analysis Table Wizard did - for each field, what range of values it has, what range of string lengths, how many values are present, etc. Maybe an --analyze option on drush migrate-import, which would trigger calling $this->analyze() instead of $this->destination->import()? Default implementation would do some basic stats, override to add more complex stuff specific to your application.
Thinking about it, it'll be real easy to add the basic support, and I've got some past analysis code I've written I can throw into the default analyze()...
Comments
Comment #1
moshe weitzman commentedI would add this as a separate drush command. Perhaps a separate module within migrate as well. It is kind of exotic.
Comment #2
Niklas Fiekas commentedSubscribe.
Comment #3
FrequenceBanane commentedsubscribe
Comment #4
mikeryanWell, looking through the queue this week for low-hanging fruit to add to Migrate 2.4, I decided to table this one. But today I had some obscure CSV files to develop a migration from, with a funky escape character that means I can't import them into Excel to work out what's in them. So, I've implemented the migrate-analyze (maz) command, which for any specified migrations will list the source fields (post-prepareRow()) and tell you whether they're numeric or string, what the value or string-length ranges are, list some sample values (or all distinct values if the list is short, as when you're dealing with status codes and the like). I'm sure it could use some tweaking, and we'll think of more analyses to perform, but please open fresh issues for those.
Comment #5
mikeryanFYI - the initial commit didn't work for XML migrations (where the source values don't get populated until applyMappings()), I've just committed a fix for that.