createdb
authorMichael Wallner <mike@php.net>
Wed, 13 May 2015 15:37:15 +0000 (17:37 +0200)
committerMichael Wallner <mike@php.net>
Wed, 13 May 2015 15:37:15 +0000 (17:37 +0200)
config/sql/createdb.sh [new file with mode: 0755]

diff --git a/config/sql/createdb.sh b/config/sql/createdb.sh
new file mode 100755 (executable)
index 0000000..6fa1562
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/sh
+#
+# run as (postgresql) superuser
+
+psql -e <<EOF
+-- createuser -DRS pharext
+CREATE
+       USER    "pharext"
+       NOCREATEDB
+       NOREPLICATION
+       NOSUPERUSER
+;
+
+-- createdb pharext -O pharext -E utf8 -l en_US.utf8
+CREATE 
+       DATABASE        "pharext"
+       OWNER           "pharext"
+       TEMPLATE        "template0"
+       ENCODING        'utf8'
+       LC_CTYPE        'en_US.utf8'
+       LC_COLLATE      'en_US.utf8'
+;
+
+\c pharext
+
+CREATE
+       EXTENSION       "uuid-ossp"
+;
+
+EOF