0

I am about to muddle thru creating 2 hooks, but I just wanted to check if someone has these hooks already, or perhaps a better idea.

pre-push: use git diff --stat --cached origin/master to see if "migrations" are being pushed. If so, then backup the db before the push.

post-recieve: run migrations

geckob
  • 7,680
  • 5
  • 30
  • 39
Tarek Adam
  • 3,387
  • 3
  • 27
  • 52

1 Answers1

2

If you are using Linux you could use a bash script to run your git command. The output command ">" and some grep command could work to determine to check upon your migrations and then execute the laravel migration command.

Jonathan
  • 512
  • 2
  • 5
  • 17