I've just new with Laravel. I have a problem when doing migrations. My Schema is just like this
public function up()
{
Schema::create('journal', function($table){
$table->increments('id');
$table->timestamp('journal_date');
$table->string('no_ref',25);
$table->string('acc_id', 10);
$table->string('description', 100);
$table->integer('debet')->default(0);
$table->integer('kredit')->default(0);
$table->primary(array('journal_date', 'no_ref', 'acc_id'));
});
}
Then when running PHP artisan migrate I get an an error
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key
defined (SQL: alter table `journal` add primary key
journal_journal_date_no_ref_acc_id_primary(`journal_date`,
`no_ref`, `acc_id`))
I did some advice to drop primary but this will drop auto increment too. I just don't know how to figure it out.