How to use php artisan migrate command of Laravel4 in Heroku?

前端 未结 6 1584
渐次进展
渐次进展 2021-02-19 05:22

I am suing Heroku dev plan for creating database using PostgreSQL. Database is created in Heroku. After running heroku pg:info command

$ heroku          


        
6条回答
  •  猫巷女王i
    2021-02-19 05:37

    with the new official php build pack you just run

    $ heroku run bash
    $ php artisan migrate
    

    or just

    $ heroku run php artisan migrate
    

    And if you want the migration to happen every time you deploy via git then add "php artisan migrate" to to composer.json in the "post-update-cmd" section of "scripts".

提交回复
热议问题