Sha256: 907ff1b47edfa7a376155f583bd270b90a13a08bb447080aea2b777ffecb23d9

Contents?: true

Size: 711 Bytes

Versions: 16

Compression:

Stored size: 711 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'
  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

16 entries across 16 versions & 1 rubygems

Version Path
geordi-2.12.3 lib/geordi/commands/migrate.rb
geordi-2.12.2 lib/geordi/commands/migrate.rb
geordi-2.12.1 lib/geordi/commands/migrate.rb
geordi-2.12.0 lib/geordi/commands/migrate.rb
geordi-3.0.0 lib/geordi/commands/migrate.rb
geordi-2.11.0 lib/geordi/commands/migrate.rb
geordi-2.10.1 lib/geordi/commands/migrate.rb
geordi-2.10.0 lib/geordi/commands/migrate.rb
geordi-2.9.0 lib/geordi/commands/migrate.rb
geordi-2.8.0 lib/geordi/commands/migrate.rb
geordi-2.7.0 lib/geordi/commands/migrate.rb
geordi-2.6.0 lib/geordi/commands/migrate.rb
geordi-2.5.0 lib/geordi/commands/migrate.rb
geordi-2.4.0 lib/geordi/commands/migrate.rb
geordi-2.3.0 lib/geordi/commands/migrate.rb
geordi-2.2.0 lib/geordi/commands/migrate.rb