Sha256: d71c5fb3d5bdb490af9ba7ae987f65888156745908708ded3a007caa2981a11b

Contents?: true

Size: 683 Bytes

Versions: 2

Compression:

Stored size: 683 Bytes

Contents

desc 'migrate', 'Migrate all databases'
long_desc <<-LONGDESC
Example: `geordi migrate`

If you are using `parallel_tests`, this runs migrations in your development
environment and `rake parallel:prepare` afterwards. Otherwise, invokes `geordi rake`
with `db:migrate`.
LONGDESC

def migrate
  invoke_cmd 'bundle_install'
  announce 'Migrating'

  if File.directory?('db/migrate')
    if Util.file_containing?('Gemfile', /parallel_tests/)
      note 'Development and parallel test databases'
      puts

      Util.system! 'bundle exec rake db:migrate parallel:prepare'
    else
      invoke_cmd 'rake', 'db:migrate'
    end
  else
    note 'No migrations directory found.'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geordi-1.10.0 lib/geordi/commands/migrate.rb
geordi-1.9.1 lib/geordi/commands/migrate.rb