mirror of
https://gitee.com/ShopeX/ECShopX
synced 2026-08-16 02:22:13 +08:00
30 lines
772 B
PHP
30 lines
772 B
PHP
<?php
|
|
|
|
namespace Database\Migrations;
|
|
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
use Doctrine\DBAL\Schema\Schema as Schema;
|
|
|
|
class Version20260813110000 extends AbstractMigration
|
|
{
|
|
/**
|
|
* @param Schema $schema
|
|
*/
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
|
|
|
$table = $schema->getTable('distribution_distributor_items');
|
|
if (!$table->hasIndex('idx_distributor_id_goods_id')) {
|
|
$table->addIndex(['distributor_id', 'goods_id'], 'idx_distributor_id_goods_id');
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param Schema $schema
|
|
*/
|
|
public function down(Schema $schema): void
|
|
{
|
|
}
|
|
}
|