mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
revert the fix index names logic, preparing for illuminate 5.7
This commit is contained in:
@@ -9,7 +9,6 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Flarum\Database\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Database\Schema\Builder;
|
use Illuminate\Database\Schema\Builder;
|
||||||
|
|
||||||
@@ -31,20 +30,16 @@ return [
|
|||||||
})
|
})
|
||||||
->update(['user_id' => null]);
|
->update(['user_id' => null]);
|
||||||
|
|
||||||
$schema->table('flags', function (Blueprint $table) use ($schema) {
|
$schema->table('flags', function (Blueprint $table) {
|
||||||
$table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade');
|
$table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade');
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
Migration::fixIndexNames($schema, $table);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
'down' => function (Builder $schema) {
|
'down' => function (Builder $schema) {
|
||||||
$schema->table('flags', function (Blueprint $table) use ($schema) {
|
$schema->table('flags', function (Blueprint $table) {
|
||||||
$table->dropForeign(['post_id']);
|
$table->dropForeign(['post_id']);
|
||||||
$table->dropForeign(['user_id']);
|
$table->dropForeign(['user_id']);
|
||||||
|
|
||||||
Migration::fixIndexNames($schema, $table);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@@ -9,24 +9,19 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Flarum\Database\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Database\Schema\Builder;
|
use Illuminate\Database\Schema\Builder;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'up' => function (Builder $schema) {
|
'up' => function (Builder $schema) {
|
||||||
$schema->table('flags', function (Blueprint $table) use ($schema) {
|
$schema->table('flags', function (Blueprint $table) {
|
||||||
$table->index('created_at');
|
$table->index('created_at');
|
||||||
|
|
||||||
Migration::fixIndexNames($schema, $table);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
'down' => function (Builder $schema) {
|
'down' => function (Builder $schema) {
|
||||||
$schema->table('flags', function (Blueprint $table) use ($schema) {
|
$schema->table('flags', function (Blueprint $table) {
|
||||||
$table->dropIndex(['created_at']);
|
$table->dropIndex(['created_at']);
|
||||||
|
|
||||||
Migration::fixIndexNames($schema, $table);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user