ORA-00942:表或视图不存在(但它确实存在)

时间:2014-09-16 12:45:53

标签: php oracle laravel

我有一个laradvel应用程序,一直在使用我的本地oracle实例。我添加了一个新表的迁移,运行它并播种它就好了。我开始为它开发一个存储库,就像我的其他存储库一样,但由于某种原因,当我运行phpunit时,它给了我ORA-00942错误。我甚至尝试在phpunit中调用播种器并且它给出了相同的错误,这很奇怪,因为它通过工匠运行时工作正常。在这一点上,我有点茫然,有什么想法吗?

迁移(新表):

<?php

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

class CreateGoalTable extends Migration {

/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::create('goal', function(Blueprint $table)
    {
        $table->increments('id');
        $table->integer('patid')->unsigned();
        $table->string('description');
        $table->string('notes');
        $table->integer('progress');
        $table->string('state');
        $table->timestamp('target');
        $table->timestamps();
        $table->softDeletes();
    });
}

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

}

迁移(旧工作台)     

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

class CreateDashTable extends Migration {

/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::create('dash', function(Blueprint $table)
    {
        $table->increments('id');
        $table->string('name');
        $table->integer('user_id')->unsigned();
        $table->string('page');
        $table->string('state');
        $table->boolean('switchable');
        $table->integer('place')->unsigned();
        $table->timestamps();
        $table->softDeletes();
    });
}

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

}

样品测试:

public function testCurrentGoals()
{
    DB::connection('oracle_laravel')->table('dash')->delete(); //works fine
    DB::connection('oracle_laravel')->table('goal')->delete(); //error
}

0 个答案:

没有答案