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>
19 lines
808 B
Bash
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.'
|