当我在Laravel
上推送我的Pagodabox
应用时,会触发取消迁移,它会一直说"命令已取消!成功" 和我在尝试查看实时应用时,收到错误消息:
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
答案 0 :(得分:1)
禁用交互功能后,工匠会自动中止在“生产”环境中运行的迁移。您可以通过将--force
标志添加到migrate命令来强制迁移运行。
web1:
before_deploy:
- 'php artisan -n migrate --seed --force'