mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-25 12:32:30 +01:00
6feaa0c372
- Bump ruby to 3.0.1 - Upgrade gems - Add suggested rubocop rake plugin - Fix rubocop warnings - Add byebug and pry
27 lines
686 B
Ruby
27 lines
686 B
Ruby
# frozen_string_literal: true
|
|
|
|
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
|
|
|
|
desc 'Run database migrations and seed data'
|
|
task prepare: %w[db:migrate rates:all]
|
|
|
|
namespace :test do
|
|
desc 'Run database migrations and seed with saved data'
|
|
task :prepare do
|
|
ENV['APP_ENV'] ||= 'test'
|
|
Rake::Task['db:migrate'].invoke
|
|
Rake::Task['rates:seed_with_saved_data'].invoke
|
|
end
|
|
end
|
|
end
|