set -e

export JWT_ISSUER=qwe
export JWT_AUDIENCE=qwe
export JWT_KEY=qwe
export DATABASE_CONNECTION_STRING="Server=localhost;Port=5432;Database=Monolith;User ID=postgres;Password=sql;"
export FILE_CONNECTION_STRING="mongodb://mongo:mongo@localhost:27017/monitoring"

MIGRATION_NAME=${1}

dotnet ef migrations add $MIGRATION_NAME -o Data/Migrations

if [ "$2" == "update" ]; then
    dotnet ef database update
fi