Git pre-commit hook to check columns in SQLAlchemy models are marked deferred before dropping them in a DB migration.
repos:
- repo: https://github.com/d3facto/sqlalchemy-check-deferred-columns-before-drop rev: v0.6 hooks: - id: sqlalchemy-check-deferred-columns-before-drop name: DB migration - Check for deferred columns on drop # Important: Pass staged files to the script pass_filenames: true files: ^db/public/versions/.*.py$ args: ['--models-path', 'db/public', '--db-migrations-path', 'db/public/versions']