mercredi 9 septembre 2020

How to write alter migration to add composite key in laravel

I am new in laravel. I have role_user table in which 3 columns are there. id, role_id, user_id. I want to have a composite key for role_id, user_id. But how can I write this I don't know.

 public function up()
 {
    Schema::table('role_users', function (Blueprint $table) {
       //     
    });
 }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire