db-init: init BASE_INSTALLED= for set -u safety
This commit is contained in:
@@ -84,6 +84,15 @@ spec:
|
||||
# check below skips the odoo step when base is already
|
||||
# installed — fresh deploys still bootstrap correctly
|
||||
# because base isn't installed in a brand-new database.
|
||||
# Init both vars to "" so `set -u` doesn't crash when
|
||||
# the schema query returns nothing (fresh DB case —
|
||||
# ir_module_module doesn't exist yet, so the inner
|
||||
# query block is skipped, leaving BASE_INSTALLED
|
||||
# unset). Without this, db-init crashlooped on every
|
||||
# fresh deploy with: "BASE_INSTALLED: parameter not
|
||||
# set".
|
||||
IS_INIT=""
|
||||
BASE_INSTALLED=""
|
||||
IS_INIT=$(PGPASSWORD="$PASSWORD" psql -h "$HOST" -p "$PORT" -U "$USER" -d "$DBNAME" -tAc \
|
||||
"SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='ir_module_module'" 2>/dev/null || true)
|
||||
if [ "$IS_INIT" = "1" ]; then
|
||||
|
||||
Reference in New Issue
Block a user