Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
636 stars 200 forks source link

migration on other db failed : Class path.database does not exist #250

Closed dimitriSpb closed 6 years ago

dimitriSpb commented 7 years ago

Hi,

I want to create table (to use jobs) on mysql but I have this error : Class path.database does not exist

This is my class :

<?php

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

class CreateJobTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection('mysql')->create('jobs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('queue');
            $table->longText('payload');
            $table->tinyInteger('attempts')->unsigned();
            $table->tinyInteger('reserved')->unsigned();
            $table->unsignedInteger('reserved_at')->nullable();
            $table->unsignedInteger('available_at');
            $table->unsignedInteger('created_at');
            $table->index(['queue', 'reserved', 'reserved_at']);
        });
    }

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

I precise connection in Shema builder because default connection is Neo4j

And when I want to run migration (I try 3 differents methods), I have it : image

Can you help me please ?

Thanks

Mulkave commented 6 years ago

Kindly note that this driver only works with Neo4j. MySQL is supported by the official Laravel installation.

dimitriSpb commented 6 years ago

I use Neo4J for all my database except job.

I want save job table on Mysql DB, how I can do using migration ?