Files
qmi-cloud-tf-modules/databases/dummy/scripts/dummy-postgres.sh
Manuel Romero 46b4467fa3 dummydata
2023-07-13 14:52:05 +02:00

26 lines
669 B
Bash

#!/bin/bash
echo "Username: $1"
echo "Password: $2"
echo "Host: $3"
echo "DB: $4"
echo "Install Adventureworks for Postgres"
cd /tmp
wget https://github.com/lorint/AdventureWorks-for-Postgres/archive/master.zip
unzip master.zip
cd AdventureWorks-for-Postgres-master/
wget https://github.com/microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks-oltp-install-script.zip
unzip AdventureWorks-oltp-install-script.zip
ruby update_csvs.rb
psql postgresql://$1:$2@$3/$4?sslmode=require -c "CREATE DATABASE \"Adventureworks\";"
psql postgresql://$1:$2@$3/Adventureworks?sslmode=require < ./install.sql
rm -fr /tmp/AdventureWorks-for-Postgres