【发布时间】:2015-07-25 18:24:39
【问题描述】:
当我在Pagodabox 上推送我的Laravel 应用程序时,它会取消迁移,它一直说“命令已取消!成功”当我尝试查看实时应用程序时,我我收到一条错误消息:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'gopagoda.posts' doesn't exist (SQL: select * from `posts`).
我确实为生产设置了所有数据库凭据(用于mysql db)。
一个应用在我的本地服务器上运行良好。
另外,这可能是相关的,我有一个免费帐户。我不确定迁移是否适用于免费帐户!?
<= :::::::::::::::::::::: END BUILD OUTPUT :::::::::::::::::::::::::::
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+> Uploading libs to storage warehouse
+> Uploading build to storage warehouse
+> Provisioning production servers (may take a while)
web1 :: BEFORE DEPLOY HOOK 1 ::
///////////////////////////////
$ php artisan -n migrate --seed
**************************************
* Application In Production! *
**************************************
Command Cancelled!
[✓] SUCCESS
我的 Boxfile:
####### PHP BOXFILE #######
# The Boxfile is a yaml config file that houses all configuration
# related to your app’s deployment and infrastructure. It allows
# you to custom-configure your app's environment specific to your
# project's needs.
# DOCUMENTATION LINKS
# The Boxfile : pagodabox.io/docs/boxfile_overview
# PHP Settings in the Boxfile : pagodabox.io/docs/boxfile_php_settings
# PHP on Pagoda Box : pagodabox.io/docs/php
# Build & Deploy Hooks : pagodabox.io/docs/build_deploy_hooks
global:
env:
- LARAVEL_ENV:production
build:
type: php
stability: production
lib_dir: 'vendor'
web1:
type: php
name: laravel
httpd_document_root: public
php_extensions:
- mcrypt
- pdo_mysql
network_dirs:
storage1:
- app/storage/cache
- app/storage/logs
- app/storage/meta
- app/storage/sessions
- app/storage/views
before_deploy:
- 'php artisan -n migrate --seed'
after_deploy:
- 'php artisan -n cache:clear'
- 'rm -f app/storage/views/*'
database1:
name: gopagoda
type: **mysql**
storage1:
type: nfs
name: laravel-writables
【问题讨论】:
-
您可以通过免费帐户使用 MySQL。查看仪表板中的数据库,它会告诉您
database1是什么类型的数据库。你的 Boxfile 是什么样的? -
是的,它是 MySQL 数据库。我尝试了一切,我认为现在迁移不适用于免费帐户(思想家应用程序)。
-
也不要将部署功能限制为免费应用程序,因此您应该能够运行该部署挂钩。我认为命令中的某些内容失败了,但是错误被抑制了。尝试注释掉 Boxfile 中的部署挂钩并进行部署。这至少可以让您的应用部署。一旦它在那里,SSH 并手动运行工匠命令,看看会发生什么。
标签: mysql pagoda-box