1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Add id to migrations table (#2794)

This commit is contained in:
Alexander Skvortsov
2021-04-19 10:35:21 -04:00
committed by GitHub
parent c7c456cb3e
commit e77365f32f
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
if (! $schema->hasColumn('migrations', 'id')) {
$schema->table('migrations', function (Blueprint $table) {
$table->increments('id')->first();
});
}
},
'down' => function (Builder $schema) {
$schema->table('migrations', function (Blueprint $table) {
$table->dropColumn('id');
});
}
];