mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Framework: Fixed Laravel 11 upgrade test issues, updated phpstan
- Fixed failing tests due to Laravel 11 changes - Updated phpstan to 3.x branch - Removed some seemingly redundant comment code, which was triggering phpstan.
This commit is contained in:
@@ -26,25 +26,19 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$sm = Schema::getConnection()->getDoctrineSchemaManager();
|
||||
$prefix = DB::getTablePrefix();
|
||||
$pages = $sm->introspectTable($prefix . 'pages');
|
||||
$books = $sm->introspectTable($prefix . 'books');
|
||||
$chapters = $sm->introspectTable($prefix . 'chapters');
|
||||
|
||||
if ($pages->hasIndex('search')) {
|
||||
if (Schema::hasIndex('pages', 'search')) {
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->dropIndex('search');
|
||||
});
|
||||
}
|
||||
|
||||
if ($books->hasIndex('search')) {
|
||||
if (Schema::hasIndex('books', 'search')) {
|
||||
Schema::table('books', function (Blueprint $table) {
|
||||
$table->dropIndex('search');
|
||||
});
|
||||
}
|
||||
|
||||
if ($chapters->hasIndex('search')) {
|
||||
if (Schema::hasIndex('chapters', 'search')) {
|
||||
Schema::table('chapters', function (Blueprint $table) {
|
||||
$table->dropIndex('search');
|
||||
});
|
||||
|
@@ -26,25 +26,19 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$sm = Schema::getConnection()->getDoctrineSchemaManager();
|
||||
$prefix = DB::getTablePrefix();
|
||||
$pages = $sm->introspectTable($prefix . 'pages');
|
||||
$books = $sm->introspectTable($prefix . 'books');
|
||||
$chapters = $sm->introspectTable($prefix . 'chapters');
|
||||
|
||||
if ($pages->hasIndex('name_search')) {
|
||||
if (Schema::hasIndex('pages', 'name_search')) {
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->dropIndex('name_search');
|
||||
});
|
||||
}
|
||||
|
||||
if ($books->hasIndex('name_search')) {
|
||||
if (Schema::hasIndex('books', 'name_search')) {
|
||||
Schema::table('books', function (Blueprint $table) {
|
||||
$table->dropIndex('name_search');
|
||||
});
|
||||
}
|
||||
|
||||
if ($chapters->hasIndex('name_search')) {
|
||||
if (Schema::hasIndex('chapters', 'name_search')) {
|
||||
Schema::table('chapters', function (Blueprint $table) {
|
||||
$table->dropIndex('name_search');
|
||||
});
|
||||
|
@@ -25,27 +25,21 @@ return new class extends Migration
|
||||
$table->index('score');
|
||||
});
|
||||
|
||||
$sm = Schema::getConnection()->getDoctrineSchemaManager();
|
||||
$prefix = DB::getTablePrefix();
|
||||
$pages = $sm->introspectTable($prefix . 'pages');
|
||||
$books = $sm->introspectTable($prefix . 'books');
|
||||
$chapters = $sm->introspectTable($prefix . 'chapters');
|
||||
|
||||
if ($pages->hasIndex('search')) {
|
||||
if (Schema::hasIndex('pages', 'search')) {
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->dropIndex('search');
|
||||
$table->dropIndex('name_search');
|
||||
});
|
||||
}
|
||||
|
||||
if ($books->hasIndex('search')) {
|
||||
if (Schema::hasIndex('books', 'search')) {
|
||||
Schema::table('books', function (Blueprint $table) {
|
||||
$table->dropIndex('search');
|
||||
$table->dropIndex('name_search');
|
||||
});
|
||||
}
|
||||
|
||||
if ($chapters->hasIndex('search')) {
|
||||
if (Schema::hasIndex('chapters', 'search')) {
|
||||
Schema::table('chapters', function (Blueprint $table) {
|
||||
$table->dropIndex('search');
|
||||
$table->dropIndex('name_search');
|
||||
|
Reference in New Issue
Block a user