Skip to content

Commit 924bd2a

Browse files
committed
Add missing migration with unique index
It was not "imported" from the extended model, so basically it was ignored..
1 parent 368fc91 commit 924bd2a

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Webgriffe\SyliusActiveCampaignPlugin\Migrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
final class Version20260227151801 extends AbstractMigration
11+
{
12+
public function up(Schema $schema): void
13+
{
14+
$this->addSql('CREATE UNIQUE INDEX channel_customer_idx ON webgriffe_sylius_active_campaign_channel_customer (channel_id, customer_id)');
15+
}
16+
17+
public function down(Schema $schema): void
18+
{
19+
$this->addSql('DROP INDEX channel_customer_idx ON webgriffe_sylius_active_campaign_channel_customer');
20+
}
21+
}

tests/TestApplication/src/Entity/Customer/ChannelCustomer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#[ORM\Entity]
1111
#[ORM\Table(name: 'webgriffe_sylius_active_campaign_channel_customer')]
12+
#[ORM\UniqueConstraint(name: 'channel_customer_idx', columns: ['channel_id', 'customer_id'])]
1213
class ChannelCustomer extends BaseChannelCustomer
1314
{
1415
}

0 commit comments

Comments
 (0)