On Sep 1, 8:06 am, Scott LaBounty <[email protected]> wrote:
> I have the following code ...
>
> <<
>         m = Sequel::Migrator
>         db = Sequel.connect(ENV['DATABASE_URL'] ||
> 'sqlite://library.sqlite')
>         dir = "dbMigration"
>         target = ENV['TARGET'] ? "#{ENV['TARGET']}" : nil
>         current = ENV['CURRENT'] ? "#{ENV['CURRENT']}" : nil
>         puts "m = #{m} db = #{db} dir = #{dir} target = #{target} current =
> #{current}"
>         # m.apply(db, dir, target.to_i, current.to_i)
>         m.run(db, dir, :target => target.to_i, :current => current.to_i)
>
>
>
> which I thought would be more or less equivalent to
>
>  sequel -m dbMigration/ -M 0 sqlite://library.sqlite
>
> if I set the TARGET value correctly. What I see though is that the
> programmatic version always goes to the latest no matter how I have TARGET
> set.
>
> What am I missing here?

I'm not sure.  Nothing jumps out at me as being obviously wrong,
though I don't understand why you would be doing:

        target = ENV['TARGET'] ? "#{ENV['TARGET']}" : nil
        current = ENV['CURRENT'] ? "#{ENV['CURRENT']}" : nil

ENV values can only be strings, so this should be equivalent:

        target = ENV['TARGET']
        current = ENV['CURRENT']

That's unrelated to your problem though.

Can you put together a self contained example?  I'll definitely take a
look at it.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to