mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 11:02:30 +01:00
Add db migrate task
This commit is contained in:
parent
951a777150
commit
09e7502d42
13
Rakefile
13
Rakefile
@ -22,4 +22,17 @@ Rake::TestTask.new do |t|
|
|||||||
t.verbose = true
|
t.verbose = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
task :default => [:test]
|
task :default => [:test]
|
||||||
|
Loading…
Reference in New Issue
Block a user