chore(prisma): enforce frontend-owned schema rollout policy

This commit is contained in:
Ruslan Bakiev
2026-02-22 15:15:58 +07:00
parent 11c0baa78d
commit 25a5e83f95
5 changed files with 106 additions and 0 deletions

22
scripts/prisma-sync.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
CANONICAL_SCHEMA="$ROOT_DIR/frontend/prisma/schema.prisma"
TARGETS=(
"$ROOT_DIR/omni_chat/prisma/schema.prisma"
"$ROOT_DIR/omni_outbound/prisma/schema.prisma"
)
if [[ ! -f "$CANONICAL_SCHEMA" ]]; then
echo "[prisma-sync] Canonical schema not found: $CANONICAL_SCHEMA" >&2
exit 1
fi
for target in "${TARGETS[@]}"; do
mkdir -p "$(dirname "$target")"
cp "$CANONICAL_SCHEMA" "$target"
echo "[prisma-sync] Updated $target"
done
echo "[prisma-sync] Done. Canonical source: $CANONICAL_SCHEMA"