Files
yhy-mager/scripts/check-delivery.sh
xiewenjun 54c318c615
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled
feat: implement license platform business flows and delivery tooling
Add admin and customer interfaces, orders, signed activation and leases, protected package delivery, keyring verification, migrations, security controls, tests and deployment documentation.

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
2026-10-09 15:33:22 +08:00

19 lines
808 B
Bash

#!/bin/sh
set -eu
expected=1
for file in backend/migrations/*.up.sql; do
[ -s "$file" ] || { echo 'empty migration' >&2; exit 1; }
base=${file%.up.sql}
[ -s "$base.down.sql" ] || { echo 'missing down migration' >&2; exit 1; }
name=${base##*/}
version=${name%%_*}
[ "$version" = "$(printf '%06d' "$expected")" ] || { echo 'migration sequence must be contiguous and unique' >&2; exit 1; }
expected=$((expected + 1))
done
[ "$expected" -gt 1 ] || { echo 'no migrations found' >&2; exit 1; }
for file in backend/migrations/*.down.sql; do
[ -s "${file%.down.sql}.up.sql" ] || { echo 'missing up migration' >&2; exit 1; }
done
for file in scripts/*.sh deploy/entrypoint.sh; do sh -n "$file"; done
printf '%s\n' 'Migration naming/pairs and shell syntax passed; this does not execute migrations or Compose.'