Module: MixedGauge::DatabaseTasks
Overview
Offers database related Rake tasks
Defined Under Namespace
Modules: TaskOrganizerForSingleClusterTask, TasksForMultipleClusters, TasksForSingleConnection
Class Method Summary
collapse
invoke_task, invoke_task_for_all_clusters
create_all_databases, drop_all_databases, load_schema_all_databases
create, drop, load_schema
Class Method Details
.ar417_above? ⇒ Boolean
26
27
28
|
# File 'lib/mixed_gauge/database_tasks.rb', line 26
def ar417_above?
ar41? && ActiveRecord::VERSION::TINY > 7
end
|
.ar41? ⇒ Boolean
21
22
23
|
# File 'lib/mixed_gauge/database_tasks.rb', line 21
def ar41?
ar4? && ActiveRecord::VERSION::MINOR == 1
end
|
.ar42? ⇒ Boolean
16
17
18
|
# File 'lib/mixed_gauge/database_tasks.rb', line 16
def ar42?
ar4? && ActiveRecord::VERSION::MINOR == 2
end
|
.ar4? ⇒ Boolean
11
12
13
|
# File 'lib/mixed_gauge/database_tasks.rb', line 11
def ar4?
ActiveRecord::VERSION::MAJOR == 4
end
|
.ar5? ⇒ Boolean
6
7
8
|
# File 'lib/mixed_gauge/database_tasks.rb', line 6
def ar5?
ActiveRecord::VERSION::MAJOR == 5
end
|
.cluster_names ⇒ Array<Symbol>
.exit_with_error ⇒ Object
71
72
73
|
# File 'lib/mixed_gauge/database_tasks.rb', line 71
def exit_with_error
exit 1
end
|
.info ⇒ Object
Show information of database sharding config.
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/mixed_gauge/database_tasks.rb', line 31
def info
puts 'All clusters registered to mixed_gauge'
puts
clusters.each do |cluster|
puts "= Cluster: #{cluster.name} ="
cluster.connections.each do |name|
puts "- #{name}"
end
puts
end
end
|
.to_rake_task(task_name) ⇒ Rake::Task
46
47
48
|
# File 'lib/mixed_gauge/database_tasks.rb', line 46
def to_rake_task(task_name)
Rake::Task[task_name]
end
|