Project

General

Profile

« Previous | Next » 

Revision 225

scripts/Makefile: Added empty_db target which uses vegbien_empty.sql

View differences:

scripts/Makefile
1
export PGOPTIONS = --client-min-messages=WARNING
2

  
3
psqlOpts = --set ON_ERROR_STOP=1 --quiet
4
psqlAdmin = sudo -u postgres psql $(psqlOpts)
5
psqlDbUser = ./util/psql_vegbien $(psqlOpts)
6

  
1 7
all: install
2 8

  
9
.SUFFIXES:
10

  
3 11
FORCE:
12
.PHONY: FORCE
4 13

  
5 14

  
6 15
install: user db
7 16

  
8 17
uninstall: rm_db rm_user
9 18

  
19
reinstall: uninstall install
20

  
10 21
reinstall_db: rm_db db
11 22

  
12
psql_admin = sudo -u postgres psql --quiet
23
empty_db:
24
	$(psqlDbUser) <../mappings/schemas/vegbien_empty.sql
13 25

  
14 26
user: FORCE
15 27
	-./admin/bien_user_create
16 28
# ignore errors about existing user
17 29

  
18 30
rm_user: FORCE
19
	echo "DROP USER bien;"|$(psql_admin)
31
	echo "DROP USER bien;"|$(psqlAdmin)
20 32

  
21 33
db: FORCE
22
	$(psql_admin) <../mappings/schemas/vegbien.sql
34
	$(psqlAdmin) <../mappings/schemas/vegbien.sql
23 35

  
24 36
rm_db: FORCE
25
	echo "DROP DATABASE vegbien;"|$(psql_admin)
37
	echo "DROP DATABASE vegbien;"|$(psqlAdmin)
26 38

  
27 39

  
28 40
test: test-map

Also available in: Unified diff