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:
committed by
GitHub
parent
c7c456cb3e
commit
e77365f32f
@@ -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');
|
||||
});
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user