Skip to content

Commit

Permalink
Unique index is not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Mar 7, 2024
1 parent 1bdcc24 commit 571d80b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tests/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ModelTest extends TestCase
{
public function tearDown(): void
{
User::raw(fn(Collection $collection) => $collection->drop());
User::truncate();
Soft::truncate();
Book::truncate();
Item::truncate();
Expand Down Expand Up @@ -1047,10 +1047,6 @@ public function testNumericFieldName(): void

public function testCreateOrFirst()
{
// Create index unique on "email" and "name"
User::raw(fn (Collection $collection) => $collection->createIndex(['email' => 1], ['unique' => true]));
User::raw(fn (Collection $collection) => $collection->createIndex(['name' => 1], ['unique' => true]));

$user1 = User::createOrFirst(['email' => 'taylorotwell@gmail.com']);

$this->assertSame('taylorotwell@gmail.com', $user1->email);
Expand Down

0 comments on commit 571d80b

Please sign in to comment.