1

When I push my Laravel app on Pagodabox, it seams to cancel migrations, it keeps saying "Command Cancelled! SUCCESS" and I when I try to see a live app, I am getting an error message:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'gopagoda.posts' doesn't exist (SQL: select * from `posts`). 

I did set up all db credentials for the production (for mysql db).

An app works fine on my local server.

Also, it may be relevant, I have a free account. I am not sure if migrations are available for free accounts!?

<= :::::::::::::::::::::: 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

My 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
DannieL
  • 11
  • 2
  • You can use MySQL with free accounts. Look at the database in your dashboard, it will tell you what type of database `database1` is. What does your Boxfile look like? – Scott May 15 '15 at 14:39
  • Yes, it is MySQL database. I tried everything, I think now that migrations are not available for free account (thinker apps). – DannieL May 16 '15 at 08:11
  • The don't limit deploy functionality to free apps either, so you should be able to run that deploy hook. I think something in the command is failing, but the error is being suppressed. Try commenting out the deploy hooks in your Boxfile and deploying. This will at least let your app deploy. Once it's up there, SSH in and run the artisan commands manually and see what happens. – Scott May 19 '15 at 20:46

1 Answers1

1

With interactivity disabled, artisan automatically aborts migrations run in a "production" environment. You can force the migration to run by adding the --force flag to the migrate command.

web1:      
  before_deploy:
    - 'php artisan -n migrate --seed --force'
Scott
  • 101
  • 3