Prevent hosts foreign key migrations (#14290)
This commit is contained in:
@@ -82,3 +82,13 @@ jobs:
|
||||
fi
|
||||
index=$((index+1))
|
||||
done
|
||||
|
||||
- name: Prevent hosts foreign keys
|
||||
run: |
|
||||
MATCHES=$(git diff --name-only origin/main | grep "migrations/" | xargs grep -i -E 'references\s*hosts\s*\(\s*id\s*\)' )
|
||||
if [ -n "$MATCHES" ]; then
|
||||
echo "❌ fail: hosts foreign keys are not allowed"
|
||||
echo "$MATCHES"
|
||||
echo "Ref: https://github.com/fleetdm/fleet/blob/main/handbook/engineering/scaling-fleet.md#foreign-keys-and-locking"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user