Added further tests, Fixed speed_update issues, improved search result query count

This commit is contained in:
Dan Brown
2015-11-29 17:33:25 +00:00
parent 22f8a408fa
commit 62338e4a8f
12 changed files with 115 additions and 53 deletions

View File

@ -13,33 +13,35 @@
$factory->define(BookStack\User::class, function ($faker) {
return [
'name' => $faker->name,
'email' => $faker->email,
'password' => str_random(10),
'name' => $faker->name,
'email' => $faker->email,
'password' => str_random(10),
'remember_token' => str_random(10),
];
});
$factory->define(BookStack\Book::class, function ($faker) {
return [
'name' => $faker->sentence,
'slug' => str_random(10),
'name' => $faker->sentence,
'slug' => str_random(10),
'description' => $faker->paragraph
];
});
$factory->define(BookStack\Chapter::class, function ($faker) {
return [
'name' => $faker->sentence,
'slug' => str_random(10),
'name' => $faker->sentence,
'slug' => str_random(10),
'description' => $faker->paragraph
];
});
$factory->define(BookStack\Page::class, function ($faker) {
$html = '<p>' . implode('</p>', $faker->paragraphs(5)) . '</p>';
return [
'name' => $faker->sentence,
'slug' => str_random(10),
'html' => '<p>' . implode('</p>', $faker->paragraphs(5)) . '</p>'
'slug' => str_random(10),
'html' => $html,
'text' => strip_tags($html)
];
});

View File

@ -54,36 +54,36 @@ class AddEntityIndexes extends Migration
public function down()
{
Schema::table('books', function (Blueprint $table) {
$table->dropIndex('slug');
$table->dropIndex('created_by');
$table->dropIndex('updated_by');
$table->dropIndex('books_slug_index');
$table->dropIndex('books_created_by_index');
$table->dropIndex('books_updated_by_index');
});
Schema::table('pages', function (Blueprint $table) {
$table->dropIndex('slug');
$table->dropIndex('book_id');
$table->dropIndex('chapter_id');
$table->dropIndex('priority');
$table->dropIndex('created_by');
$table->dropIndex('updated_by');
$table->dropIndex('pages_slug_index');
$table->dropIndex('pages_book_id_index');
$table->dropIndex('pages_chapter_id_index');
$table->dropIndex('pages_priority_index');
$table->dropIndex('pages_created_by_index');
$table->dropIndex('pages_updated_by_index');
});
Schema::table('page_revisions', function (Blueprint $table) {
$table->dropIndex('page_id');
$table->dropIndex('page_revisions_page_id_index');
});
Schema::table('chapters', function (Blueprint $table) {
$table->dropIndex('slug');
$table->dropIndex('book_id');
$table->dropIndex('priority');
$table->dropIndex('created_by');
$table->dropIndex('updated_by');
$table->dropIndex('chapters_slug_index');
$table->dropIndex('chapters_book_id_index');
$table->dropIndex('chapters_priority_index');
$table->dropIndex('chapters_created_by_index');
$table->dropIndex('chapters_updated_by_index');
});
Schema::table('activities', function (Blueprint $table) {
$table->dropIndex('book_id');
$table->dropIndex('user_id');
$table->dropIndex('entity_id');
$table->dropIndex('activities_book_id_index');
$table->dropIndex('activities_user_id_index');
$table->dropIndex('activities_entity_id_index');
});
Schema::table('views', function (Blueprint $table) {
$table->dropIndex('user_id');
$table->dropIndex('entity_id');
$table->dropIndex('views_user_id_index');
$table->dropIndex('views_viewable_id_index');
});
}
}