Closed joboscribe closed 7 years ago
We have the following migration and when we run tests they fail because
PDOException: SQLSTATE[HY000]: General error: 1 there is already a table named block
Here's the migration:
public function up() { Schema::create('block', function(Blueprint $table) { $table->increments('block_id'); $table->string('field')->default('')->index('field'); $table->string('operator', 6)->default('')->index('operator'); $table->string('block')->default('')->index('block'); $table->integer('weight')->unsigned()->nullable()->default(1)->index('weight'); $table->string('added_by', 16)->nullable(); $table->timestamp('ts')->default(DB::raw('CURRENT_TIMESTAMP')); }); }
I removed the index->() calls and the error went away.
index->()
Let me know what other info i can provide that might be of help.
This seems to be related to #94, index names need to be unique across the entire DB in SQLite. Simply remove the index name to let Laravel create a unique name for you. Hope that helps :)
We have the following migration and when we run tests they fail because
Here's the migration:
I removed the
index->()
calls and the error went away.Let me know what other info i can provide that might be of help.