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