thuss / standalone-migrations

A gem to use Rails Database Migrations in non Rails projects
http://gabrito.com/post/standalone-migrations-using-rails-migrations-in-non-rails-projects
MIT License
992 stars 152 forks source link

db/config.yml is required in the moment the tasks are loaded. #152

Open salzig opened 5 years ago

salzig commented 5 years ago

db/config.yml is required in the moment the tasks are loaded.

I tend to use a rake task like the following to setup development environments, without having having the actually used config under version control.

namespace :dev do
  desc 'Setup Dev Environment'
  task setup: 'db/config.yml'

  # one rule to rule them all. Copy any .yml.example to matching .yml
  rule '.yml' => '.yml.example' do |task|
    cp task.source, task.name
  end
end

Sadly StandaloneMigrations::Tasks.load_tasks will fail with a missing db/config.yml, so i can't run my dev:setup tasks, which would create the file.

Would be awesome if the db/config.yml would only be required when the tasks are executed, not just loaded.