This is my migration file code
Schema::create('hierarchies', function (Blueprint $table) {
$table->integer('id');
$table->integer('hierarchy_id');
$table->timestamps();
});
I want my ID column will be auto increment without primary and hierarchy_id will be my primary key.
How to do that?
My Answer:
increments('id');
$table->string('name');
$table->integer('parent_id')->unsigned()->nullable();
$table->integer('order')->unsigned()->autoIncrement();
});
Rate this post
3 of 5 based on 8464 votesComments