vendredi 24 août 2018

Laravel migration doesn't create foreign key on a different database

I try to add a foreign key relation with a table in other_database_name. Migration command runs whole migration without any error; code creates tables with no error; but doesn't create a foreign key relation.

Schema::connection($my_database_connection)->create('product_metas', 
    function (Blueprint $table) {
        $table->increments('id');
        $table->integer("product_id")->references('id')->on('other_database_name.products');



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Nl7ESU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire