Sha256: 9330854e07ca3f3d2dc92309586f903f070c76cffe66d5c0f44a4496a7cef102
Contents?: true
Size: 1.22 KB
Versions: 62
Compression:
Stored size: 1.22 KB
Contents
require 'arjdbc/tasks/jdbc_database_tasks' module ArJdbc module Tasks class MSSQLDatabaseTasks < JdbcDatabaseTasks def purge test = deep_dup(configuration) test_database = resolve_database(test) test['database'] = 'master' establish_connection(test) connection.recreate_database!(test_database) end def structure_dump(filename) config = config_from_url_if_needed `smoscript -s #{config['host']} -d #{config['database']} -u #{config['username']} -p #{config['password']} -f #{filename} -A -U` end def structure_load(filename) config = config_from_url_if_needed `sqlcmd -S #{config['host']} -d #{config['database']} -U #{config['username']} -P #{config['password']} -i #{filename}` end private def config_from_url_if_needed config = self.config if config['url'] && ! config.key?('database') config = config_from_url(config['url']) end config end def deep_dup(hash) dup = hash.dup dup.each_pair do |k,v| tv = dup[k] dup[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? deep_dup(tv) : v end dup end end end end
Version data entries
62 entries across 62 versions & 3 rubygems