Skip to content

Commit eaf230c

Browse files
added index to friendly url to cover most used method (#3860)
1 parent 4f4e797 commit eaf230c

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/Component/Router/FriendlyUrl/FriendlyUrl.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
* @ORM\Table(
1111
* name="friendly_urls",
1212
* indexes={
13-
* @ORM\Index(columns={"route_name", "entity_id"})
13+
* @ORM\Index(columns={"route_name", "entity_id"}),
14+
* @ORM\Index(columns={"route_name", "entity_id", "domain_id", "main"}),
1415
* }
1516
* )
1617
* @ORM\Entity
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Shopsys\FrameworkBundle\Migrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Override;
9+
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration;
10+
11+
class Version20250313074307 extends AbstractMigration
12+
{
13+
/**
14+
* @param \Doctrine\DBAL\Schema\Schema $schema
15+
*/
16+
#[Override]
17+
public function up(Schema $schema): void
18+
{
19+
$this->sql('CREATE INDEX IDX_64EC05ABF3667F8381257D5D115F0EE5BF28CD64
20+
ON friendly_urls (route_name, entity_id, domain_id, main)');
21+
}
22+
23+
/**
24+
* @param \Doctrine\DBAL\Schema\Schema $schema
25+
*/
26+
#[Override]
27+
public function down(Schema $schema): void
28+
{
29+
}
30+
}

0 commit comments

Comments
 (0)