Closed allaire closed 8 years ago
There is no good reason for it being commented out, other than omission on my part! I will update this. Thanks for all your feedback :+1:
Will this be updated?
@peterjmit I think the within
is not necessary, since it's already in the laravel:artisan command: https://github.com/capistrano/laravel/blob/master/lib/capistrano/tasks/migrations.rake#L3
Also, @peterjmit, Any idea why the after hook is not working in this case?
namespace :deploy do
task :migrate do
puts "Running migrations..."
invoke 'laravel:artisan', 'migrate'
end
after :updated, 'deploy:set_permissions:chmod'
end
# TODO: Run manually, after hook is not working
# after 'deploy:updated', 'deploy:migrate'
When deploying in verbose mode using the after hook I get:
...
** Invoke deploy:migrate (first_time)
** Execute deploy:migrate
Running migrations...
** Invoke laravel:artisan
...
But when I run the command cap production deploy:migrate -v --trace
directly I get:
** Invoke deploy:migrate (first_time)
** Execute deploy:migrate
Running migrations...
** Invoke laravel:artisan (first_time)
** Execute laravel:artisan
INFO[0fdde119] Running /usr/bin/env php artisan migrate --env=production on production.site.com
Any idea why? maybe @leehambley can chime in?
@allaire off the top of my head might well be due to rake only allowing tasks to execute once, this was fixed in http://github.com/capistrano/symfony, I will see if I can fix it here too
@peterjmit Where can I read more about this issue?
I've noticed that although the codebase has been updated to comment back in the database migration (https://github.com/capistrano/laravel/commit/8f84614dda5a82c9979683e8bcc4de60e389464f) if you do a gem install of it, you get the commented out version.
Same to me. I guess something should be updated in the gems repository. The version 0.0.2 is too old: https://rubygems.org/gems/capistrano-laravel
Sorry for the late response. I'll be helping maintain this plugin for the foreseeable future. If any of these issues are still persisting (all of the tickets are quite old), please let me know and I will do what I can to try and help fix things.
@ikari7789 I ran into this issue today. I tried running invoke 'laravel:artisan', 'migrate'
and I got an error that it had already been invoked. Also when I use the build in migration method it says Application in Production -- command cancelled
@mcblum PR #20 should have fixed this. I'll release a minor version update shortly with the fix. Additionally, there is a laravel:migrate_db
task which will run migrations.
The migration task is commented out and not up to date. I currently have:
should it be updated with the code above?