mirror of
https://github.com/flarum/core.git
synced 2025-05-06 07:25:22 +02: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 = $this->connection->getSchemaBuilder();
|
||||||
|
|
||||||
$schema->create($this->table, function ($table) {
|
$schema->create($this->table, function ($table) {
|
||||||
|
$table->increments('id');
|
||||||
$table->string('migration');
|
$table->string('migration');
|
||||||
$table->string('extension')->nullable();
|
$table->string('extension')->nullable();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user