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

1 year ago
require "logger"
require "minitest/test_task"
Minitest::TestTask.create
1 year ago
namespace :db do
desc "Run migrations"
task :migrate, [:version] do |t, args|
1 year ago
require_relative "db"
1 year ago
require "sequel/core"
Sequel.extension :migration
1 year ago
1 year ago
version = args[:version].to_i if args[:version]
1 year ago
Sequel::Migrator.run(DB, "db/migrations", target: version, use_transactions: true)
1 year ago
end
end