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.

18 lines
433 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|
require "sequel/core"
Sequel.extension :migration
version = args[:version].to_i if args[:version]
Sequel.connect(ENV.fetch("DATABASE_URL"), logger: Logger.new($stderr)) do |db|
Sequel::Migrator.run(db, "db/migrations", target: version)
end
end
end