mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-08 07:16:58 +02:00
test/Makefile: Allow configuring the superuser database name
Also, don't ignore errors while setting up the database
This commit is contained in:
parent
dfedce2aba
commit
30f90cb848
@ -35,6 +35,7 @@ REGRESS= allcols.load \
|
|||||||
xzero.load
|
xzero.load
|
||||||
|
|
||||||
PGLOADER ?= ../build/bin/pgloader
|
PGLOADER ?= ../build/bin/pgloader
|
||||||
|
PGSUPERUSER ?= postgres
|
||||||
|
|
||||||
EXTRA_OPTS =
|
EXTRA_OPTS =
|
||||||
ifneq (,$(findstring ccl,$(CL)))
|
ifneq (,$(findstring ccl,$(CL)))
|
||||||
@ -53,16 +54,16 @@ remote: prepare $(REMOTE:.load=.out)
|
|||||||
all: prepare $(OUT)
|
all: prepare $(OUT)
|
||||||
|
|
||||||
prepare: bossa.sql sakila
|
prepare: bossa.sql sakila
|
||||||
-dropdb -U postgres pgloader
|
-dropdb -U $(PGSUPERUSER) pgloader
|
||||||
-dropdb -U postgres stocks
|
-dropdb -U $(PGSUPERUSER) stocks
|
||||||
-dropdb -U postgres ip4r
|
-dropdb -U $(PGSUPERUSER) ip4r
|
||||||
-createdb -U postgres -O `whoami` pgloader
|
createdb -U $(PGSUPERUSER) -O `whoami` pgloader
|
||||||
-createdb -U postgres -O `whoami` stocks
|
createdb -U $(PGSUPERUSER) -O `whoami` stocks
|
||||||
-createdb -U postgres -O `whoami` ip4r
|
createdb -U $(PGSUPERUSER) -O `whoami` ip4r
|
||||||
-psql -d pgloader -c 'create schema expected'
|
psql -d pgloader -c 'create schema expected'
|
||||||
-psql -U postgres -d pgloader -c 'create extension ip4r'
|
psql -U $(PGSUPERUSER) -d pgloader -c 'create extension ip4r'
|
||||||
-psql -U postgres -d ip4r -c 'create extension ip4r'
|
psql -U $(PGSUPERUSER) -d ip4r -c 'create extension ip4r'
|
||||||
-psql -d stocks -f bossa.sql
|
psql -d stocks -f bossa.sql
|
||||||
|
|
||||||
errors.out: errors.load
|
errors.out: errors.load
|
||||||
-$(PGLOADER) $<
|
-$(PGLOADER) $<
|
||||||
@ -81,8 +82,8 @@ $(TMPDIR)/sakila-db/sakila-schema.sql: data/sakila-db.zip
|
|||||||
unzip $< -d $(TMPDIR)
|
unzip $< -d $(TMPDIR)
|
||||||
|
|
||||||
sakila: $(TMPDIR)/sakila-db/sakila-schema.sql
|
sakila: $(TMPDIR)/sakila-db/sakila-schema.sql
|
||||||
-dropdb -U postgres sakila
|
-dropdb -U $(PGSUPERUSER) sakila
|
||||||
-createdb -U postgres -O `whoami` sakila
|
-createdb -U $(PGSUPERUSER) -O `whoami` sakila
|
||||||
-echo "DROP DATABASE sakila" | mysql -u root
|
-echo "DROP DATABASE sakila" | mysql -u root
|
||||||
echo "SOURCE $(TMPDIR)/sakila-db/sakila-schema.sql" | mysql -u root
|
echo "SOURCE $(TMPDIR)/sakila-db/sakila-schema.sql" | mysql -u root
|
||||||
echo "SOURCE $(TMPDIR)/sakila-db/sakila-data.sql" | mysql -u root
|
echo "SOURCE $(TMPDIR)/sakila-db/sakila-data.sql" | mysql -u root
|
||||||
|
Loading…
Reference in New Issue
Block a user