相关疑难解决方法(0)

Laravel Migrations - 表前缀问题

我正在构建一个虚拟站点来测试Laravel 3.x.

我现在正在创建我的网站迁移.一切都很好,直到出现以下错误:

SQLSTATE[42s02]: Base table or view not found: 1146 Table 'databasenamehere.prefix_laravel_migrations' doesn't exist
Run Code Online (Sandbox Code Playgroud)

问题是laravel突然开始在'laravel_migrations'表中加上前缀(当它应该只与其他表一起使用时).

我想知道我做错了什么或是否是一个已知的问题.

我正在尝试运行以下迁移(使用php artisan migrate application命令):

public function up()
{
    Schema::create('siteinfo', function ($table) 
    {
        $table->engine = 'InnoDB';
        $table->string('name');
        $table->string('title')->nullable();
        $table->string('corp_name')->nullable();
        $table->string('corp_addr')->nullable();
        $table->string('corp_phone')->nullable();
        $table->string('corp_city')->nullable();
        $table->string('corp_state')->nullable();
        $table->string('corp_email')->nullable();
        $table->string('main_url')->nullable();
        $table->timestamps();
    });
}
Run Code Online (Sandbox Code Playgroud)

任何帮助都会很棒.

编辑1:

  • 几分钟前我注意到我的表根本没有前缀,即使在config/database.php文件中正确设置了"prefix"配置.
  • 如果我删除前缀,一切正常.我知道我可以在每次运行的迁移中手动设置前缀,但是......

php migration laravel laravel-3

2
推荐指数
1
解决办法
7119
查看次数

标签 统计

laravel ×1

laravel-3 ×1

migration ×1

php ×1