fleet/git-hooks/backend/hooks/db-schema
Victor Lyuboslavsky 46719c9fb2
Auto-generate and check Android schema.sql (#26720)
For #26218 

This is an infrastructure change. No functional feature changes.
2025-02-28 16:30:40 -06:00

11 lines
341 B
Bash

#!/bin/bash
## DB Schema Dump
if [[ $DB_SCHEMA_DUMP ]]; then
make dump-test-schema
if [[ $(git diff-files --patch server/datastore/mysql/schema.sql server/mdm/android/mysql/schema.sql) ]]; then
echo "❌ fail: uncommited changes in schema.sql"
echo "please run 'make dump-test-schema' and commit the changes"
exit 1
fi
fi