mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 11:02:30 +01:00
13 lines
312 B
Ruby
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
|