mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-28 03:04:15 +00:00
More robust database creation script.
This commit is contained in:
parent
b7a037f0d8
commit
f4cc7b3d59
@ -8,17 +8,17 @@ DBNAME="${1:-rscds}"
|
||||
DBADIR="`dirname \"$0\"`"
|
||||
|
||||
# FIXME: Need to check that the database was actually created.
|
||||
createdb -E UTF8 "${DBNAME}"
|
||||
createdb -E UTF8 "${DBNAME}" -T template0
|
||||
|
||||
#
|
||||
# This will fail if the language already exists.
|
||||
# FIXME: test for the language first, perhaps.
|
||||
# This will fail if the language already exists, but it should not
|
||||
# because we created from template0.
|
||||
createlang plpgsql "${DBNAME}"
|
||||
|
||||
#
|
||||
# FIXME: filter non-error output
|
||||
psql -f "${DBADIR}/rscds.sql" "${DBNAME}"
|
||||
psql -q -f "${DBADIR}/rscds.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )"
|
||||
|
||||
psql -f "${DBADIR}/caldav_functions.sql" "${DBNAME}"
|
||||
psql -q -f "${DBADIR}/caldav_functions.sql" "${DBNAME}"
|
||||
|
||||
psql -f "${DBADIR}/sample-data.sql" "${DBNAME}"
|
||||
psql -q -f "${DBADIR}/sample-data.sql" "${DBNAME}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user