Skip to content

Commit

Permalink
Rename sylius_refund_payment to sylius_refund_refund_payment
Browse files Browse the repository at this point in the history
  • Loading branch information
diimpp committed Mar 10, 2020
1 parent a731e22 commit 055fba9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions migrations/Version20200306153205.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20200306153205 extends AbstractMigration
{
public function getDescription(): string
{
return 'Renames sylius_refund_payment table to sylius_refund_refund_payment';
}

public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('RENAME TABLE sylius_refund_payment TO sylius_refund_refund_payment');
$this->addSql('ALTER TABLE sylius_refund_refund_payment DROP INDEX IDX_EFA5A4B25AA1164F, ADD INDEX IDX_EC283EA55AA1164F (payment_method_id)');
$this->addSql('ALTER TABLE sylius_refund_refund_payment DROP FOREIGN KEY FK_EFA5A4B25AA1164F, ADD CONSTRAINT FK_EC283EA55AA1164F FOREIGN KEY (payment_method_id) REFERENCES sylius_payment_method (id)');
}

public function down(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('RENAME TABLE sylius_refund_refund_payment TO sylius_refund_payment');
$this->addSql('ALTER TABLE sylius_refund_payment DROP INDEX IDX_EC283EA55AA1164F, ADD INDEX IDX_EFA5A4B25AA1164F (payment_method_id)');
$this->addSql('ALTER TABLE sylius_refund_payment DROP FOREIGN KEY FK_EC283EA55AA1164F, ADD CONSTRAINT FK_EFA5A4B25AA1164F FOREIGN KEY (payment_method_id) REFERENCES sylius_payment_method (id)');
}
}
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine/RefundPayment.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
>
<mapped-superclass name="Sylius\RefundPlugin\Entity\RefundPayment" table="sylius_refund_payment">
<mapped-superclass name="Sylius\RefundPlugin\Entity\RefundPayment" table="sylius_refund_refund_payment">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
Expand Down

0 comments on commit 055fba9

Please sign in to comment.