frankfurter/lib/tasks/db.rake
2014-03-14 12:15:27 +00:00

13 lines
312 B
Ruby

namespace :db do
desc 'Run database migrations'
task :migrate do
Sequel.extension(:migration)
db = Sequel::DATABASES.first
dir = App.root.join('db/migrate')
opts = {}
opts.update(target: ENV['VERSION'].to_i) if ENV['VERSION']
Sequel::IntegerMigrator.new(db, dir, opts).run
end
end