Sha256: be907c5f7f81b6a17216799a1de10b8857e707579cc7d6aa2b1e8f323be08488
Contents?: true
Size: 1.25 KB
Versions: 39
Compression:
Stored size: 1.25 KB
Contents
namespace :oracle do task :setup do require 'bundler' Bundler.require(:default, :oracle) end desc 'Build the Oracle test database' task :build_database => :setup do spec = CompositePrimaryKeys::ConnectionSpec['oracle'] ActiveRecord::Base.clear_all_connections! ActiveRecord::Base.establish_connection(spec) schema = File.join(PROJECT_ROOT, 'test', 'fixtures', 'db_definitions', 'oracle.sql') sql = File.read(schema) sql.split(';').each do |command| ActiveRecord::Base.connection.execute(command) unless command.blank? end ActiveRecord::Base.clear_all_connections! end desc 'Drop the Oracle test database' task :drop_database => :setup do spec = CompositePrimaryKeys::ConnectionSpec['oracle'] ActiveRecord::Base.clear_all_connections! ActiveRecord::Base.establish_connection(spec) schema = File.join(PROJECT_ROOT, 'test', 'fixtures', 'db_definitions', 'oracle.drop.sql') sql = File.read(schema) sql.split(';').each do |command| ActiveRecord::Base.connection.execute(command) end ActiveRecord::Base.clear_all_connections! end desc 'Rebuild the Oracle test database' task :rebuild_database => [:drop_database, :build_database] end
Version data entries
39 entries across 39 versions & 1 rubygems