I am trying to create a table with Laravel migrations, but I have problems. I just need to create a table with a primary pair ("id" and "revision"), being the "id" auto-increment. I can do this in MySQL, but I am unable to do this with Laravel Migrations, since increments () also sets the field as the main one. So far I have this:
Schema::create('bibliographies', function(Blueprint $table)
{
$table->increments('id');
$table->integer('revision');
...
$table->timestamps();
$table->softDeletes();
$table->primary(array('id', 'revision'));
});
Note: changing the increments () method is not an option, since it is the core of Laravel.
Thank you for your help.
source
share