Skip to content

Instantly share code, notes, and snippets.

@codebycliff
Created May 27, 2020 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codebycliff/f0272b54d063f2e923359a7c3deb7b0a to your computer and use it in GitHub Desktop.
Save codebycliff/f0272b54d063f2e923359a7c3deb7b0a to your computer and use it in GitHub Desktop.
Dangerfile for structure.sql
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