Skip to content

Commit f28a1ac

Browse files
committed
Migration
1 parent 842f072 commit f28a1ac

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎app/Services/ComputerScienceResourceService.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ function () use ($computerScienceResource, $sortBy, $request) {
157157
*/
158158
private function existingConflictingResource(array $data): ?ComputerScienceResource
159159
{
160-
// If there is a resource with these matching properties, it is safe to say it is the same resource
161-
return ComputerScienceResource::where('name', $data['name'])
162-
->where('page_url', $data['page_url'])
163-
->first();
160+
return ComputerScienceResource::where('page_url', $data['page_url'])->first();
164161
}
165162
}

database/migrations/2025_08_29_170217_create_soft_delete_on_resources.php renamed to database/migrations/2025_08_29_170217_add_soft_delete_and_indexing_to_computer_science_resources.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public function up(): void
1313
{
1414
Schema::table('computer_science_resources', function (Blueprint $table) {
1515
$table->softDeletes();
16+
$table->index('page_url');
1617
});
1718
}
1819

@@ -23,6 +24,7 @@ public function down(): void
2324
{
2425
Schema::table('computer_science_resources', function (Blueprint $table) {
2526
$table->dropSoftDeletes();
27+
$table->dropIndex(['page_url']);
2628
});
2729
}
2830
};

0 commit comments

Comments
 (0)