mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-10-29 23:32:35 +01:00
13 lines
325 B
Ruby
13 lines
325 B
Ruby
namespace :db do
|
|
desc 'Run database migrations'
|
|
task migrate: :environment 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
|