Skip to content

Refactor Migration timestamp validation

Max Orefice requested to merge morefice/refactor/timestamp-validation into master

What does this MR do and why?

This MR does things:

  • Refactor our existing timestamp validator
  • Adds a pre-push hook to check timestamp to avoid migration in the future.

How to set up and validate locally

Future timestamp

  1. Change a migration in db/migrate and set it in the future
  2. run scripts/validate_migration_timestamps
  3. Should get the following output:
➜  gitlab git:(morefice/refactor/timestamp-validation) ✗ scripts/validate_migration_timestamps
$ git diff --name-only --diff-filter=A master -- db/migrate db/post_migrate

Error: Invalid Timestamp was found in migrations

db/migrate/20251117104131_create_trigger_to_web_hook_logs.rb: has a future timestamp
Edited by Max Orefice

Merge request reports

Loading