I am using Neo4j in my application with /Vinelab/NeoEloquent. Now the problem is that when I run php artisan neo4j:migrate --database=neo4j
, node for the migration table is created.
Not any labels defined in function up() is not created. What should I do to solve this?
Schema class is,
<?php
use Vinelab\NeoEloquent\Schema\Blueprint;
use Vinelab\NeoEloquent\Migrations\Migration;
class CreateTestpostsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Neo4jSchema::label('Testposts', function(Blueprint $label)
{
$label->unique('tpid');
$label->index('name');
$label->index('content');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Neo4jSchema::drop('Testposts');
}
}
According to your Schema code, no labels should be expected to be created. You are setting a constraint on the
tpid
to be unique, and indexing thename
andcontent
of the nodes withTestposts
label.To check if your migration has taken effect:
tpid
and you should get an errorname
andcontent
properties, this link should help with that: http://neo4j.com/docs/stable/cypherdoc-basic-query-tuning-example.htmlOn a side note, if the Label of the node in your model is
Post
or anything other thanTestposts
, then you should changeTestposts
to whatever is in your model for this to work properly.