Sha256: 88618c5e308decb3a0dd93cdde0eb9775b68e7ed7800ff23c413f11d265a4eeb

Contents?: true

Size: 941 Bytes

Versions: 4

Compression:

Stored size: 941 Bytes

Contents

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

namespace :sqlite3 do
  desc 'Build the sqlite test databases'
  task :build_databases => :load_connection do
    schema = File.join(PROJECT_ROOT, 'test', 'fixtures', 'db_definitions', 'sqlite.sql')
    dbfile = File.join(PROJECT_ROOT, connection_string)
    cmd = "mkdir -p #{File.dirname(dbfile)}"
    puts cmd
    sh %{ #{cmd} }
    cmd = "sqlite3 #{dbfile} < #{schema}"
    puts cmd
    sh %{ #{cmd} }
  end

  desc 'Drop the sqlite test databases'
  task :drop_databases => :load_connection do 
    dbfile = connection_string
    sh %{ rm -f #{dbfile} }
  end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
composite_primary_keys-4.0.0.beta7 tasks/databases/sqlite3.rake
composite_primary_keys-4.0.0.beta6 tasks/databases/sqlite3.rake
composite_primary_keys-4.0.0.beta5 tasks/databases/sqlite3.rake
composite_primary_keys-4.0.0.beta4 tasks/databases/sqlite3.rake