Created
April 30, 2018 13:12
-
-
Save bogdan/0693af787f1eb3b5378ce95273e83165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require Rails.root.join 'support/2018/20180202160337_db_extraction' | |
class DevShard1Extraction < ActiveRecord::Migration[5.1] | |
extractor = DbExtraction.new | |
if extractor.db_match? | |
raise 'Please set the shard 1 DB to be different from primary DB. You may take the config/deploy/templates/database.yml or modify your own copy.' | |
end | |
shard 1 | |
def change | |
return unless Rails.env.development? | |
DbExtraction.new.perform | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment