stmichael / data-import

sequel based dsl to migrate data from a legacy database to a new home.
MIT License
42 stars 9 forks source link

"Import without source" deprecated? #42

Closed stmichael closed 12 years ago

stmichael commented 12 years ago

We have an acceptance test "import without source". The import config looks like this:

import 'Static objects' do
  to 'objects'

  after do
    target_database[:objects].insert(:name => 'a box')
    target_database[:objects].insert(:name => 'my cat')
  end
end

I think this is deprecated since we now have script blocks. You could easily rewrite this definition to:

script 'Static objects' do
  body do
    target_database[:objects].insert(:name => 'a box')
    target_database[:objects].insert(:name => 'my cat')
  end
end

This is even less code.

@senny do you agree with me?

senny commented 12 years ago

I agree.

senny commented 12 years ago

I think we could even go one step further and drop the functionality for "#after" blocks. In the end, you can just write a script-block with a dependency on the import and you get the same benefits.

stmichael commented 12 years ago

Yes, master Yoda ;-)

senny commented 12 years ago

let's deprecate the after block then and have the message say you should use a script block with a dependency.

senny commented 12 years ago

closed in favor of #45