#! /bin/bash

psql -U postgres < global.sql

psql -U postgres -d iddb < init.sql
psql -U postgres -d iddb < pgcrypto.sql

echo "SET search_path = iddb, pgcrypto;" | cat - ../src/y_octet_t/y_octet_t.sql | psql -U postgres -d iddb
echo "SET search_path = iddb, pgcrypto;" | cat - ../src/y_ntlm/y_ntlm.sql | psql -U postgres -d iddb 
echo "SET search_path = iddb, pgcrypto;" | cat - ../src/y_uuid/y_uuid.sql | psql -U postgres -d iddb 

psql -U iddb -d iddb < iddb_create.sql

