You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
392 B
19 lines
392 B
require "logger"
|
|
|
|
require "minitest/test_task"
|
|
|
|
Minitest::TestTask.create
|
|
|
|
namespace :db do
|
|
desc "Run migrations"
|
|
task :migrate, [:version] do |t, args|
|
|
require_relative "db"
|
|
|
|
require "sequel/core"
|
|
Sequel.extension :migration
|
|
|
|
version = args[:version].to_i if args[:version]
|
|
Sequel::Migrator.run(DB, "db/migrations", target: version, use_transactions: true)
|
|
end
|
|
end
|