Sha256: 6be3f7d2883b2f36e2cdcacd758324c0148b17c904007ded6f20ddf40aab95f7

Contents?: true

Size: 791 Bytes

Versions: 17

Compression:

Stored size: 791 Bytes

Contents

migration_tasks = %w[db:migrate db:migrate:up db:migrate:down db:migrate:reset db:migrate:redo db:rollback]

# Rails 6 supports multi-database setups
if defined?(Rails::Application) && Rails.version.split('.').first.to_i >= 6
  require 'active_record'

  databases = ActiveRecord::Tasks::DatabaseTasks.setup_initial_database_yaml

  # the db:migrate tasks each have a separate command for migrating a single database
  ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |spec_name|
    migration_tasks.concat(%w[db:migrate db:migrate:up db:migrate:down].map { |task| "#{task}:#{spec_name}" })
  end
end

migration_tasks.each do |task|
  Rake::Task[task].enhance([:ghost_adapter_exec])
end

task ghost_adapter_exec: :environment do
  GhostAdapter::Internal.enable_ghost_migration!
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ghost_adapter-0.7.0 lib/tasks/ghost_adapter.rake
ghost_adapter-0.6.0 lib/tasks/ghost_adapter.rake
ghost_adapter-0.5.0 lib/tasks/ghost_adapter.rake
ghost_adapter-0.4.2 lib/tasks/ghost_adapter.rake
ghost_adapter-0.4.1 lib/tasks/ghost_adapter.rake
ghost_adapter-0.4.0 lib/tasks/ghost_adapter.rake
ghost_adapter-0.3.0 lib/tasks/ghost_adapter.rake
ghost_adapter-0.2.3 lib/tasks/ghost_adapter.rake
ghost_adapter-0.2.2 lib/tasks/ghost_adapter.rake
ghost_adapter-0.2.1 lib/tasks/ghost_adapter.rake
ghost_adapter-0.2.0 lib/tasks/ghost_adapter.rake
ghost_adapter-0.1.4 lib/tasks/ghost_adapter.rake
ghost_adapter-0.1.3 lib/tasks/ghost_adapter.rake
ghost_adapter-0.1.2 lib/tasks/ghost_adapter.rake
ghost_adapter-0.1.1 lib/tasks/ghost_adapter.rake
ghost_adapter-0.1.0 lib/tasks/ghost_adapter.rake
ghost_adapter-0.0.2 lib/tasks/ghost_adapter.rake