Sha256: f7235e6b6c5abfdb25f43d6b04d9fe24c1bfd90f0ebf91d3ef1bcad19392a488

Contents?: true

Size: 747 Bytes

Versions: 5

Compression:

Stored size: 747 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'
  invoke_cmd 'yarn_install'
  Interaction.announce 'Migrating'

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geordi-3.2.0 lib/geordi/commands/migrate.rb
geordi-3.1.0 lib/geordi/commands/migrate.rb
geordi-3.0.3 lib/geordi/commands/migrate.rb
geordi-3.0.2 lib/geordi/commands/migrate.rb
geordi-3.0.1 lib/geordi/commands/migrate.rb