Created
May 27, 2020 18:45
-
-
Save codebycliff/f0272b54d063f2e923359a7c3deb7b0a to your computer and use it in GitHub Desktop.
Dangerfile for structure.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
migration_added = git.added_files.include?('db/migrate/*.rb') | |
schema_modified = git.modified_files.include?('db/structure.sql') | |
warn 'Migration has been added, but structure.sql has not been modified' if | |
migration_added && !schema_modified | |
warn 'Schema has been modified, but no migration has been added' if | |
schema_modified && !migration_added |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment