#!/bin/bash

set -a && source .env && set +a 

echo "This will drop the existing db, press ctrl-c within 10 sec to abort"
sleep 10 

# let's remove the db; 
docker exec reco-logo-db bash -c "mysqladmin -u root --password=12tycho -f drop recomed"

./devops/deploy-local

SQL_FILE=./database/med300824.sql ./devops/dodb
sleep 5

docker-compose -f ./docker-compose-logo-dev.yml down

# make sure ! the migrations run again 
./devops/deploy-local

docker exec -it reco-logo-php1 bash -c "ls -t /home/logs/*.php|head -n 1|xargs cat"   
