davical/dba/create-database.sh
Andrew McMillan 923d10879a Split the supported locales out of the base data so it can be more easily
re-loaded on upgrades.  Added locale for Russian translation from Nick Khazov.
2006-11-14 10:07:53 +13:00

27 lines
641 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}/supported_locales.sql" "${DBNAME}"