> 1. Use external data source (say, have all data in CSV or XML file)
> and then load data from it
> 2. Or include data directly into an MDL file.
>
> Any thoughts on that?
For my simple use I think having the data directly in the MDL would be
the least trouble, but I think the other solution is better given its
flexibility for larger amount of imports.
You could allow an "insert into" variant to import from an external
CSV file. Preferably, the filename should be a concatenation of the
migration version, the table and the format (convention over
configuration):
"insert into Author format => csv" (which would import from
20090226100407_Author.csv)
The tricky part is how to handle downgrades. Should the data be
deleted again? If so, how do we delete only the inserted rows (the
identity wasn't part of the import, so perhaps we need to persist it
in a table)?
> As for data migration, this is a more complex issue. Honestly, I
> haven't thought about it much, but it's on my to-do list as well.
I am just brainstorming, but a solution could be to allow custom
processes to be launched as part of the migration. A kind of hooks;
"if the migration is successful, execute this command". This is not
the best way to solve it, and I don't think it can replace real data
migrations, but at least it would be a nice extensibility point, if
you need to do something that the format doesn't support (yet).
--
Troels Thomsen