Make migrating after upgrading MySQL easier. (#12971)
Many people got stuck by this migration as it would fail on index creation after the table was created
This commit is contained in:
parent
7ef302a8b9
commit
ff55f674c1
|
@ -12,6 +12,11 @@ class CreatePortGroupsTable extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
// drop table if exists, migration can fail when creating index.
|
||||
if (Schema::hasTable('port_groups')) {
|
||||
Schema::drop('port_groups');
|
||||
}
|
||||
|
||||
Schema::create('port_groups', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->unique();
|
||||
|
|
Loading…
Reference in New Issue