Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
apisub
Commits
11ff9861
Commit
11ff9861
authored
Feb 02, 2019
by
Stephane Crozat
Browse files
Amélioration du script d'installation de la DB
parent
def15d51
Changes
2
Hide whitespace changes
Inline
Side-by-side
INSTALL
View file @
11ff9861
...
...
@@ -2,7 +2,7 @@
## Create user and db
sudo su postgres
sql/db_init.sh
(edit path
and password first)
sql/db_init.sh
sql (give access to postgres user,
and password first)
## Test
psql -h localhost -U apisub -d apisub
...
...
sql/db_init.sh
View file @
11ff9861
#!/bin/bash
sqlfiles
=
'/home/stc/git/apisub/sql'
SQL
=
`
dirname
$0
`
psql
-c
"DROP DATABASE IF EXISTS apisub"
psql
-c
"DROP USER IF EXISTS apisub"
psql
-c
"CREATE USER apisub WITH ENCRYPTED PASSWORD 'password'"
psql
-c
"CREATE DATABASE apisub WITH OWNER apisub"
psql
-d
apisub
-f
"
$
sqlfiles
/apisub_functions.sql"
psql
-d
apisub
-f
"
$
sqlfiles
/apisub_admin.sql"
psql
-d
apisub
-f
"
$
sqlfiles
/apisub_tables.sql"
psql
-d
apisub
-f
"
$
sqlfiles
/apisub_views.sql"
psql
-d
apisub
-f
"
$
sqlfiles
/apisub_dataset.sql"
psql
-d
apisub
-f
"
$
SQL
/apisub_functions.sql"
psql
-d
apisub
-f
"
$
SQL
/apisub_admin.sql"
psql
-d
apisub
-f
"
$
SQL
/apisub_tables.sql"
psql
-d
apisub
-f
"
$
SQL
/apisub_views.sql"
psql
-d
apisub
-f
"
$
SQL
/apisub_dataset.sql"
psql
-d
apisub
-c
"GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO apisub"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment