【发布时间】: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