#!/bin/bash

# Expect that
#  * PostgreSQL exits on this machine and running
#  * There is no concurrent executions for this script

DBNAME='mpi'
DSN="dbname=${DBNAME}"
USER_ID=42
echo "DROP DATABASE IF EXISTS ${DBNAME}; CREATE DATABASE ${DBNAME}" | psql

cd `dirname $0`/../../mdb && make install db=$DBNAME && cd -;
python init_user.py --dsn="${DSN}" --uid=$USER_ID
python utils_lang.py --dsn="${DSN}" --uid=$USER_ID $*

