#!/bin/bash 

cp .megatest/main.db megatest.db

for db in $(ls .megatest/?.db); do
  echo $db
  sqlite3 $db "SELECT * FROM tests" | sqlite3 megatest.db ".import /dev/stdin tests"
done
