Skip to content

Commit f856d71

Browse files
committed
Init: create extensions in template1 and postgres db
1 parent 345de23 commit f856d71

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Perform all actions as $POSTGRES_USER
6+
export PGUSER="$POSTGRES_USER"
7+
8+
# Create global extension
9+
echo "Creating extension intarray globally"
10+
"${psql[@]}" <<- 'EOSQL'
11+
CREATE EXTENSION IF NOT EXISTS intarray;
12+
EOSQL
13+
14+
# Create extension in template1 and $POSTGRES_DB
15+
for DB in template1 "$POSTGRES_DB"; do
16+
echo "Creating extension intarray into $DB"
17+
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
18+
CREATE EXTENSION IF NOT EXISTS intarray;
19+
EOSQL
20+
done

shared/init-scripts/002-intarray.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Perform all actions as $POSTGRES_USER
6+
export PGUSER="$POSTGRES_USER"
7+
8+
# Create global extension
9+
echo "Creating extension unaccent globally"
10+
"${psql[@]}" <<- 'EOSQL'
11+
CREATE EXTENSION IF NOT EXISTS unaccent;
12+
EOSQL
13+
14+
# Create extension in template1 and $POSTGRES_DB
15+
for DB in template1 "$POSTGRES_DB"; do
16+
echo "Creating extension unaccent into $DB"
17+
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
18+
CREATE EXTENSION IF NOT EXISTS unaccent;
19+
EOSQL
20+
done

shared/init-scripts/003-unaccent.sql

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)