【问题标题】:How can I tell if Elastic Beanstalk is running my config files?如何判断 Elastic Beanstalk 是否正在运行我的配置文件?
【发布时间】:2016-02-11 22:11:39
【问题描述】:

我在部署的应用程序中遇到错误:

Base table or view not found: 1146 Table 'ebdb.users' doesn't exist

这让我相信我的php artisan migrate 命令不起作用,并且users 表没有被创建。

这是我的配置文件之一(在我的 .elasticbeanstalk 文件夹中)

container_commands:
    00testCommand:
        command: "echo test"
    01migrateSeed:
        command: "php artisan migrate --force"
    02seed: 
        command: "php artisan db:seed --force"

这是我创建的用户迁移文件:

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('email')->unique();
            $table->string('referral_id')->unique();
            $table->string('referred_by')->nullable()->default(null);
            $table->string('password', 60);
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}

我是否遗漏了一些明显的东西?此错误与我的迁移无关吗?我想知道这些命令是否正在运行,但在 Elastic Beanstalk 环境日志中找不到它们。

任何帮助表示赞赏,谢谢。

【问题讨论】:

    标签: php amazon-web-services amazon-elastic-beanstalk


    【解决方案1】:

    将配置文件移动到.ebextensions 文件夹。它不属于.elasticbeanstalk一个

    【讨论】:

    • 我没有这个文件夹 - 我可以创建它还是有一个我应该使用的特定命令?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-29
    • 2014-07-31
    • 2019-01-25
    • 2013-04-11
    • 2010-09-23
    相关资源
    最近更新 更多