Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'active_record'
- blacklist = {
- icis_production: [ 'patient_versions', 'patients' ],
- snowflake_production: [ 'persons' ]
- }
- blacklist.each_pair do |database, blacklisted_tables|
- spec = {
- adapter: :postgresql,
- database: database,
- username: ENV['GM_USERNAME'],
- password: ENV['GM_PASSWORD']
- }
- ActiveRecord::Base.establish_connection(spec)
- puts "Tables for #{database} without blacklisted tables:"
- tables_wo_blacklist = ActiveRecord::Base.connection.tables - blacklisted_tables
- puts " #{tables_wo_blacklist.sort.join(', ')}"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement