mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 02:23:49 +08:00
Since we now lock down search_path during update/downgrade there are some additional requirements for writing sql files.
17 lines
462 B
Bash
Executable File
17 lines
462 B
Bash
Executable File
#! /bin/bash
|
|
|
|
SCRIPT_DIR=$(dirname ${0})
|
|
SRC_DIR=$(dirname ${SCRIPT_DIR})
|
|
|
|
if grep -i "IF NOT EXISTS" ${SRC_DIR}/sql/*.sql ${SRC_DIR}/sql/*/*.sql; then
|
|
cat <<EOF
|
|
|
|
Update scripts must unconditionally add new objects and fail when the object
|
|
already exists otherwise this might enable privilege escalation attacks where
|
|
an attacker can precreate objects that get used in later parts of the scripts
|
|
instead of the objects created by timescaledb.
|
|
|
|
EOF
|
|
exit 1
|
|
fi
|