We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
First of all thanks for making this plugin, saved me so much hours already!
I found this issue where a PRIMARY key with multiple index collumns would not export correctly to a migration.
I have to following Index in Workbench:
This results in the following migration:
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateUpgradesClubsTable extends Migration { /** * Schema table name to migrate * @var string */ public $set_schema_table = 'upgrades_clubs'; /** * Run the migrations. * @table upgrades_clubs * * @return void */ public function up() { if (Schema::hasTable($this->set_schema_table)) return; Schema::create($this->set_schema_table, function (Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('upgrade_id'); $table->unsignedInteger('club_id'); $table->index(["upgrade_id"], 'fk_upgrades_has_clubs_upgrades1_idx'); $table->index(["club_id"], 'fk_upgrades_has_clubs_clubs1_idx'); $table->foreign('upgrade_id', 'fk_upgrades_has_clubs_upgrades1_idx') ->references('id')->on('upgrades') ->onDelete('cascade') ->onUpdate('no action'); $table->foreign('club_id', 'fk_upgrades_has_clubs_clubs1_idx') ->references('id')->on('clubs') ->onDelete('cascade') ->onUpdate('no action'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists($this->set_schema_table); } }
However this should result in the following migration:
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateUpgradesClubsTable extends Migration { /** * Schema table name to migrate * @var string */ public $set_schema_table = 'upgrades_clubs'; /** * Run the migrations. * @table upgrades_clubs * * @return void */ public function up() { if (Schema::hasTable($this->set_schema_table)) return; Schema::create($this->set_schema_table, function (Blueprint $table) { $table->engine = 'InnoDB'; $table->unsignedInteger('upgrade_id'); $table->unsignedInteger('club_id'); $table->primary(['upgrade_id', 'club_id']); $table->index(["upgrade_id"], 'fk_upgrades_has_clubs_upgrades1_idx'); $table->index(["club_id"], 'fk_upgrades_has_clubs_clubs1_idx'); $table->foreign('upgrade_id', 'fk_upgrades_has_clubs_upgrades1_idx') ->references('id')->on('upgrades') ->onDelete('cascade') ->onUpdate('no action'); $table->foreign('club_id', 'fk_upgrades_has_clubs_clubs1_idx') ->references('id')->on('clubs') ->onDelete('cascade') ->onUpdate('no action'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists($this->set_schema_table); } }
Thanks in advance!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
First of all thanks for making this plugin, saved me so much hours already!
I found this issue where a PRIMARY key with multiple index collumns would not export correctly to a migration.
I have to following Index in Workbench:
This results in the following migration:
However this should result in the following migration:
Thanks in advance!
The text was updated successfully, but these errors were encountered: