Skip to content

Commit 56fb325

Browse files
committed
upgrade.sh: run slave_only SQL after slave SQL
The slave_only SQL may have triggers that depend on functions created in the slave SQL.
1 parent 45c1a41 commit 56fb325

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

upgrade.sh

+10-10
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ then
5757
OUTPUT=`./admin/psql --system "$DATABASE" < ./admin/sql/DisableLastUpdatedTriggers.sql 2>&1` || ( echo "$OUTPUT" ; exit 1 )
5858
fi
5959

60+
################################################################################
61+
# Scripts that should run on *all* nodes (master/slave/standalone)
62+
63+
echo `date` : 'Running upgrade scripts for all nodes'
64+
if [ -e "$EXTENSIONS_SQL" ]
65+
then
66+
./admin/psql --system "$DATABASE" < "$EXTENSIONS_SQL" || exit 1
67+
fi
68+
./admin/psql "$DATABASE" < $SQL_DIR/${NEW_SCHEMA_SEQUENCE}.slave.sql || exit 1
69+
6070
################################################################################
6171
# Migrations that apply for only slaves
6272
if [ "$REPLICATION_TYPE" = "$RT_SLAVE" ]
@@ -68,16 +78,6 @@ then
6878
fi
6979
fi
7080

71-
################################################################################
72-
# Scripts that should run on *all* nodes (master/slave/standalone)
73-
74-
echo `date` : 'Running upgrade scripts for all nodes'
75-
if [ -e "$EXTENSIONS_SQL" ]
76-
then
77-
./admin/psql --system "$DATABASE" < "$EXTENSIONS_SQL" || exit 1
78-
fi
79-
./admin/psql "$DATABASE" < $SQL_DIR/${NEW_SCHEMA_SEQUENCE}.slave.sql || exit 1
80-
8181
################################################################################
8282
# Re-enable replication
8383

0 commit comments

Comments
 (0)