#!/bin/sh # # SQLite: relocate stored stack paths after a DATA_DIR change. # See ../relocate-stack-paths.sh for usage. Does NOT move files - updates DB only. set -e DB_LABEL="SQLite" # Locate the database (env override, Docker default, then local dev). DB_PATH="${DOCKHAND_DB:-/app/data/db/dockhand.db}" if [ ! -f "$DB_PATH" ] && [ -f "./data/db/dockhand.db" ]; then DB_PATH="./data/db/dockhand.db" fi if [ ! -f "$DB_PATH" ]; then echo "Error: SQLite database not found at $DB_PATH" echo "Set DOCKHAND_DB to the database path." exit 1 fi DB_DISPLAY="$DB_PATH" # SQL-escape a value for single-quoted string literals. _sql_escape() { printf "%s" "$1" | sed "s/'/''/g"; } db_list_stack_paths() { # One line per non-null compose/env path: \t\t