Revision 6331
Added by Aaron Marcuse-Kubitza about 12 years ago
Makefile | ||
---|---|---|
200 | 200 |
psqlAsAdminVegbien := $(psqlAsAdmin) vegbien |
201 | 201 |
psqlAsBien := bin/psql_vegbien $(psqlOpts) |
202 | 202 |
bienPassword := $(shell cat config/bien_password) |
203 |
bienReadPassword := $(shell cat config/bien_read_password) |
|
203 | 204 |
|
204 | 205 |
##### VegBIEN DB |
205 | 206 |
|
206 |
#### DB and bien user
|
|
207 |
#### DB and users
|
|
207 | 208 |
|
208 | 209 |
confirmRmDb = $(call confirm,WARNING: This will delete your entire VegBIEN\ |
209 | 210 |
DB!,This includes all archived imports and staging tables.) |
... | ... | |
217 | 218 |
|
218 | 219 |
mk_db: _always |
219 | 220 |
-echo "CREATE USER bien PASSWORD '$(bienPassword)';"|$(psqlAsAdmin) |
221 |
-echo "CREATE USER bien_read PASSWORD '$(bienReadPassword)' IN ROLE bien \ |
|
222 |
NOINHERIT;"|$(psqlAsAdmin) |
|
220 | 223 |
-echo "CREATE DATABASE vegbien WITH OWNER bien TEMPLATE template1 \ |
221 | 224 |
ENCODING 'UTF8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';"|$(psqlAsAdmin) |
222 | 225 |
-echo "CREATE EXTENSION hstore SCHEMA pg_catalog;"|$(psqlAsAdminVegbien) |
... | ... | |
231 | 234 |
rm_db: _always |
232 | 235 |
@$(confirmRmDb) |
233 | 236 |
echo "DROP DATABASE IF EXISTS vegbien;"|$(psqlAsAdmin) |
237 |
echo "DROP USER IF EXISTS bien_read;"|$(psqlAsAdmin) |
|
234 | 238 |
echo "DROP USER IF EXISTS bien;"|$(psqlAsAdmin) |
235 | 239 |
|
236 | 240 |
reinstall_db: _always rm_db db ; |
Also available in: Unified diff
root Makefile: VegBIEN DB: DB and users: Also create bien_read user for read-only access to the DB