我在部署的应用程序上遇到错误:
Base table or view not found: 1146 Table 'ebdb.users' doesn't exist
这让我相信php artisan migrate
命令不起作用,users
表也没有创建。
这是我的一个配置文件(在我的.aelasticbeanstall文件夹中)
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环境日志中找不到它们。
感谢任何帮助,谢谢。
将配置文件移动到.ebextensions
文件夹中。它不属于.elasticbeanstalk
一个