Sha256: 9cc175462b9ed29089b64f411c75f764b38a4f7d894821d474d0a29fc0dda1c0

Contents?: true

Size: 876 Bytes

Versions: 17

Compression:

Stored size: 876 Bytes

Contents

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

17 entries across 17 versions & 1 rubygems

Version Path
composite_primary_keys-3.1.11 tasks/databases/sqlite3.rake
composite_primary_keys-4.0.0.beta3 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.10 tasks/databases/sqlite3.rake
composite_primary_keys-4.0.0.beta2 tasks/databases/sqlite3.rake
composite_primary_keys-4.0.0.beta1 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.9 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.8 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.7 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.6 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.5 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.4 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.2 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.1 tasks/databases/sqlite3.rake
composite_primary_keys-3.1.0 tasks/databases/sqlite3.rake
composite_primary_keys-3.0.9 tasks/databases/sqlite3.rake
composite_primary_keys-3.0.8 tasks/databases/sqlite3.rake
composite_primary_keys-3.0.7 tasks/databases/sqlite3.rake