Initial release: DictIA v0.8.14-alpha (fork de Speakr, AGPL-3.0)
This commit is contained in:
21
scripts/pre-commit
Executable file
21
scripts/pre-commit
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Pre-commit hook: runs PostgreSQL migration compatibility tests
|
||||
# when migration-related files are staged.
|
||||
#
|
||||
# Install: ln -sf ../../scripts/pre-commit .git/hooks/pre-commit
|
||||
|
||||
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
|
||||
|
||||
# Only run if migration-related files are staged
|
||||
if echo "$STAGED_FILES" | grep -qE '^(src/init_db\.py|src/utils/database\.py|src/models/)'; then
|
||||
echo "Migration files changed — running PostgreSQL compatibility checks..."
|
||||
python tests/test_migration_compatibility.py
|
||||
if [ $? -ne 0 ]; then
|
||||
echo ""
|
||||
echo "Pre-commit hook FAILED: PostgreSQL migration compatibility issues found."
|
||||
echo "Fix the issues above before committing."
|
||||
exit 1
|
||||
fi
|
||||
echo "All migration compatibility checks passed."
|
||||
fi
|
||||
Reference in New Issue
Block a user