Sha256: 6f01803c281a8747665d66a97ec95e28edcf157d3f8f58d652a3a96567b3e996

Contents?: true

Size: 898 Bytes

Versions: 10

Compression:

Stored size: 898 Bytes

Contents

require File.join(PROJECT_ROOT, 'lib', 'composite_primary_keys')
require File.join(PROJECT_ROOT, 'test', 'connections', 'connection_spec')

namespace :postgresql do
  desc 'Build the PostgreSQL test databases'
  task :build_databases => :load_connection do
    sh %{ createdb #{connection_string} "#{SPEC['database']}" }

    schema = File.join(PROJECT_ROOT, 'test', 'fixtures', 'db_definitions', 'postgresql.sql')
    sh %{ psql #{connection_string} "#{SPEC['database']}" -f #{schema} }
  end

  desc 'Drop the PostgreSQL test databases'
  task :drop_databases => :load_connection do 
    sh %{ dropdb #{connection_string} "#{SPEC['database']}" }
  end

  desc 'Rebuild the PostgreSQL test databases'
  task :rebuild_databases => [:drop_databases, :build_databases]

  task :load_connection do
    require File.join(PROJECT_ROOT, "test", "connections", "native_postgresql", "connection")
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
composite_primary_keys-5.0.0.rc1 tasks/databases/postgresql.rake
composite_primary_keys-4.1.2 tasks/databases/postgresql.rake
composite_primary_keys-4.1.1 tasks/databases/postgresql.rake
composite_primary_keys-4.0.0 tasks/databases/postgresql.rake
composite_primary_keys-4.0.0.beta9 tasks/databases/postgresql.rake
composite_primary_keys-4.0.0.beta8 tasks/databases/postgresql.rake
composite_primary_keys-4.0.0.beta7 tasks/databases/postgresql.rake
composite_primary_keys-4.0.0.beta6 tasks/databases/postgresql.rake
composite_primary_keys-4.0.0.beta5 tasks/databases/postgresql.rake
composite_primary_keys-4.0.0.beta4 tasks/databases/postgresql.rake