mirror of
https://github.com/flarum/framework.git
synced 2024-11-22 12:48:28 +08:00
Add id to migrations table (#2794)
This commit is contained in:
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');
|
||||
});
|
||||
}
|
||||
];
|
|
@ -98,6 +98,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface
|
|||
$schema = $this->connection->getSchemaBuilder();
|
||||
|
||||
$schema->create($this->table, function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('migration');
|
||||
$table->string('extension')->nullable();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user