如何在Heroku中使用Laravel4的php artisan migration命令? [英] How to use php artisan migrate command of Laravel4 in Heroku?

查看:124
本文介绍了如何在Heroku中使用Laravel4的php artisan migration命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在起诉Heroku开发计划,以使用 PostgreSQL 创建数据库.数据库是在Heroku中创建的.运行heroku pg:info命令后

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

$ heroku pg:info
=== HEROKU_POSTGRESQL_XXX_URL
Plan:        Hobby-dev
Status:      available
Connections: 1
PG Version:  9.3.1
Created:     2013-11-27 04:00 UTC
Data Size:   6.4 MB
Tables:      0
Rows:        0/10000 (In compliance)
Fork/Follow: Unsupported
Rollback:    Unsupported

结果显示零个表,这是正确的.

Result shows zero tables, which is correct.

在我的本地计算机上,表是通过使用以下命令创建的,这些命令在 Laravel4 框架中受支持.

In my local machine tables are created by using following command which are supported in Laravel4 framework.

php artisan迁移

php artisan db:seed

但是似乎我无法在heroku中运行此命令来创建表和转储数据.请给我打电话,如何在Heroku中创建本地数据库的副本.

But it seems like I cannot run this command in heroku to create table and dump data. Please tel me how can I create a copy of my local database in Heroku.

谢谢

推荐答案

花了一些时间,但我可以通过运行以下命令来使用它:

It took a little digging, but I was able to use it by running this command:

heroku run /app/php/bin/php /app/www/artisan migrate

所以我学到的教训是:在所有远程工匠命令前面加上heroku run /app/php/bin/php /app/www/artisan

So the lesson I learned was this: prefix all remote artisan commands with heroku run /app/php/bin/php /app/www/artisan

这篇关于如何在Heroku中使用Laravel4的php artisan migration命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆