mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 21:34:06 +02:00
align case
This commit is contained in:
@@ -9,7 +9,7 @@ set -e
|
|||||||
CONFIG_HOME="/config"
|
CONFIG_HOME="/config"
|
||||||
PGDATA="${PGDATA:-/config/database}"
|
PGDATA="${PGDATA:-/config/database}"
|
||||||
PG_VERSION_FILE="$PGDATA/pg_major_version"
|
PG_VERSION_FILE="$PGDATA/pg_major_version"
|
||||||
vchord_VERSION_FILE="$PGDATA/vchord_version"
|
VCHORD_VERSION_FILE="$PGDATA/vchord_version"
|
||||||
|
|
||||||
# Define current PostgreSQL major version
|
# Define current PostgreSQL major version
|
||||||
PG_MAJOR_VERSION="${PG_MAJOR:-15}"
|
PG_MAJOR_VERSION="${PG_MAJOR:-15}"
|
||||||
@@ -141,13 +141,13 @@ store_vchord_version() {
|
|||||||
local version
|
local version
|
||||||
version=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" \
|
version=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" \
|
||||||
-tAc "SELECT extversion FROM pg_extension WHERE extname = 'vchord';")
|
-tAc "SELECT extversion FROM pg_extension WHERE extname = 'vchord';")
|
||||||
echo "$version" > "$vchord_VERSION_FILE"
|
echo "$version" > "$VCHORD_VERSION_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function: Detect previous and new vchord versions, and upgrade if needed
|
# Function: Detect previous and new vchord versions, and upgrade if needed
|
||||||
upgrade_vchord_extension() {
|
upgrade_vchord_extension() {
|
||||||
local current_version desired_version
|
local current_version desired_version
|
||||||
current_version=$(cat "$vchord_VERSION_FILE" 2>/dev/null || echo "unknown")
|
current_version=$(cat "$VCHORD_VERSION_FILE" 2>/dev/null || echo "unknown")
|
||||||
desired_version=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" \
|
desired_version=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT" \
|
||||||
-tAc "SELECT extversion FROM pg_extension WHERE extname = 'vchord';")
|
-tAc "SELECT extversion FROM pg_extension WHERE extname = 'vchord';")
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ upgrade_vchord_extension() {
|
|||||||
-c "DROP INDEX IF EXISTS clip_index;" >/dev/null 2>&1
|
-c "DROP INDEX IF EXISTS clip_index;" >/dev/null 2>&1
|
||||||
|
|
||||||
# Store new vchord version
|
# Store new vchord version
|
||||||
echo "$desired_version" > "$vchord_VERSION_FILE"
|
echo "$desired_version" > "$VCHORD_VERSION_FILE"
|
||||||
else
|
else
|
||||||
bashio::log.info "'vchord' extension is already at the latest version ($desired_version)."
|
bashio::log.info "'vchord' extension is already at the latest version ($desired_version)."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user