From e12139c6368eb24466679efc0553439cf52fa52d Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 5 Nov 2007 22:56:33 +1300 Subject: [PATCH] Move the inclusion of the AWL tables out of the database SQL. --- dba/create-database.sh | 9 +++++++-- dba/davical.sql | 4 ---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dba/create-database.sh b/dba/create-database.sh index 17b18667..1c888545 100755 --- a/dba/create-database.sh +++ b/dba/create-database.sh @@ -42,7 +42,12 @@ fi create_plpgsql_language # -# FIXME: filter non-error output +# Load the AWL base tables and schema management tables +psql -q -f "/usr/share/awl/dba/awl-tables.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )" +psql -q -f "/usr/share/awl/dba/schema-management.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )" + +# +# Load the DAViCal tables psql -q -f "${DBADIR}/davical.sql" "${DBNAME}" 2>&1 | egrep -v "(^CREATE |^GRANT|^BEGIN|^COMMIT| NOTICE: )" psql -q -f "${DBADIR}/caldav_functions.sql" "${DBNAME}" @@ -61,7 +66,7 @@ fi if [ "$ADMINPW" = "" ] ; then # OK. They didn't supply one, and pwgen didn't work, so we hack something # together from /dev/random ... - ADMINPW="`dd if=/dev/urandom bs=512 count=1 2>/dev/null | tr -c -d "a-zA-HJ-NP-Y0-9" | cut -c2-9`" + ADMINPW="`dd if=/dev/urandom bs=512 count=1 2>/dev/null | tr -c -d "a-km-zA-HJ-NP-Y0-9" | cut -c2-9`" fi if [ "$ADMINPW" = "" ] ; then diff --git a/dba/davical.sql b/dba/davical.sql index ce52431a..b8dc8a0a 100644 --- a/dba/davical.sql +++ b/dba/davical.sql @@ -1,10 +1,6 @@ -- Really Simple CalDAV Store - Database Schema -- --- Use the usr, group and schema management stufffrom libawl-php -\i /usr/share/awl/dba/awl-tables.sql -\i /usr/share/awl/dba/schema-management.sql - -- The main event. Where we store the things the calendar throws at us. CREATE TABLE caldav_data ( user_no INT references usr(user_no) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE,