mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-02-05 02:03:54 +00:00
26 lines
634 B
Bash
Executable File
26 lines
634 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Build the RSCDS database
|
|
#
|
|
|
|
DBNAME="${1:-rscds}"
|
|
|
|
DBADIR="`dirname \"$0\"`"
|
|
|
|
# FIXME: Need to check that the database was actually created.
|
|
createdb -E UTF8 "${DBNAME}" -T template0
|
|
|
|
#
|
|
# 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 -q -f "${DBADIR}/rscds.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )"
|
|
|
|
psql -q -f "${DBADIR}/caldav_functions.sql" "${DBNAME}"
|
|
|
|
psql -q -f "${DBADIR}/base-data.sql" "${DBNAME}"
|
|
psql -q -f "${DBADIR}/sample-data.sql" "${DBNAME}"
|