#!/usr/bin/env bash # Adds the missing base tables to the company databases (SPEC ยง14, ADR 0026), and with --demo the demo data to the # tables still empty (--scale N repeats the demo catalogues N times). Rows already there are never changed. # scripts/seed.sh --base [--company CODE] # scripts/seed.sh --demo [--scale N] [--company CODE] # scripts/seed.sh --remove-demo [--company CODE] removes only the rows marked demo (and what belongs to them) # In the container (shipped as /app/scripts/seed.sh, same KHAEMHAT_* variables as the service): # docker compose run --rm --entrypoint /app/scripts/seed.sh khaemhat --base # On a development machine it runs the project with the variables already set in the shell (see scripts/run-dev.sh). set -euo pipefail if [[ -f /app/Khaemhat.Web.dll ]]; then # The entrypoint prepares the user and waits for the database, then runs "dotnet Khaemhat.Web.dll seed ...". exec /app/entrypoint.sh seed "$@" fi root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" exec dotnet run --project "$root/src/Khaemhat.Web" -- seed "$@"