Sha256: 6996b6d35ab8477b80c566c0ff6e4dbe9dd31ecd85ae2e088b46a9a38c800d07

Contents?: true

Size: 759 Bytes

Versions: 17

Compression:

Stored size: 759 Bytes

Contents

namespace :sqlite do
  task :setup do
    require 'bundler'
    Bundler.require(:default, :sqlite)
  end

  desc 'Build the sqlite test database'
  task :build_database => :setup do
    spec = CompositePrimaryKeys::ConnectionSpec['sqlite']
    schema = File.join(PROJECT_ROOT, 'test', 'fixtures', 'db_definitions', 'sqlite.sql')
    FileUtils.mkdir_p(File.dirname(spec['database']))
    cmd = "sqlite3 #{spec['database']} < #{schema}"
    puts cmd
    sh %{ #{cmd} }
  end

  desc 'Drop the sqlite test database'
  task :drop_database => :setup do
    spec = CompositePrimaryKeys::ConnectionSpec['sqlite']
    sh %{ rm -f #{spec['database']} }
  end

  desc 'Rebuild the sqlite test database'
  task :rebuild_database => [:drop_database, :build_database]
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
composite_primary_keys-14.0.9 tasks/databases/sqlite.rake
composite_primary_keys-14.0.8 tasks/databases/sqlite.rake
composite_primary_keys-13.0.8 tasks/databases/sqlite.rake
composite_primary_keys-14.0.7 tasks/databases/sqlite.rake
composite_primary_keys-14.0.6 tasks/databases/sqlite.rake
composite_primary_keys-13.0.7 tasks/databases/sqlite.rake
composite_primary_keys-13.0.6 tasks/databases/sqlite.rake
composite_primary_keys-14.0.5 tasks/databases/sqlite.rake
composite_primary_keys-13.0.5 tasks/databases/sqlite.rake
composite_primary_keys-13.0.4 tasks/databases/sqlite.rake
composite_primary_keys-14.0.4 tasks/databases/sqlite.rake
composite_primary_keys-14.0.3 tasks/databases/sqlite.rake
composite_primary_keys-13.0.3 tasks/databases/sqlite.rake
composite_primary_keys-14.0.2 tasks/databases/sqlite.rake
composite_primary_keys-13.0.2 tasks/databases/sqlite.rake
composite_primary_keys-14.0.1 tasks/databases/sqlite.rake
composite_primary_keys-11.0.0.rc2 tasks/databases/sqlite.rake