Class: DBRotator

Inherits:
Object
  • Object
show all
Defined in:
lib/db_rotator.rb

Defined Under Namespace

Classes: Schema

Constant Summary collapse

TIME_FORMAT =
"%Y%m%d"

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ DBRotator



6
7
8
9
10
# File 'lib/db_rotator.rb', line 6

def initialize(config)
  @config = config.config
  @schemas = []
  populate_schemas
end

Instance Method Details

#importObject



24
25
26
27
# File 'lib/db_rotator.rb', line 24

def import
  import_dump
  populate_schemas
end

#refreshObject



17
18
19
20
21
22
# File 'lib/db_rotator.rb', line 17

def refresh
  download_dump
  import
  prune
  grant_access
end

#rotateObject



12
13
14
15
# File 'lib/db_rotator.rb', line 12

def rotate
  refresh
  update_db_yaml
end