Browse Source

Switch merchant

feature/ticket
Guillaume 3 years ago
parent
commit
af4884b7cf
3 changed files with 54 additions and 3 deletions
  1. +1
    -1
      config/packages/doctrine.yaml
  2. +51
    -0
      migrations/Version20210604073921.php
  3. +2
    -2
      src/Entity/Merchant/MerchantConfig.php

+ 1
- 1
config/packages/doctrine.yaml View File

@@ -15,7 +15,7 @@ doctrine:
alias: App
resolve_target_entities:
Lc\SovBundle\Model\User\UserInterface: App\Entity\User\User
Lc\SovBundle\Doctrine\Extension\FileInterface: App\Entity\File\File
Lc\SovBundle\Model\File\FileInterface: App\Entity\File\File
Lc\CaracoleBundle\Model\Address\AddressInterface: App\Entity\Address\Address
Lc\CaracoleBundle\Model\Config\TaxRateInterface: App\Entity\Config\TaxRate
Lc\CaracoleBundle\Model\Config\UnitInterface: App\Entity\Config\Unit

+ 51
- 0
migrations/Version20210604073921.php View File

@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210604073921 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895E511F091');
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895F5B7AF75');
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895FDD13F95');
$this->addSql('DROP INDEX UNIQ_3CA56895E511F091 ON merchant_config');
$this->addSql('DROP INDEX UNIQ_3CA56895F5B7AF75 ON merchant_config');
$this->addSql('DROP INDEX IDX_3CA56895FDD13F95 ON merchant_config');
$this->addSql('ALTER TABLE merchant_config ADD image_id INT DEFAULT NULL, ADD name VARCHAR(63) NOT NULL, ADD value LONGTEXT DEFAULT NULL, DROP credit_config_id, DROP address_id, DROP title, DROP description, DROP meta_title, DROP meta_description, DROP old_urls, DROP slug, DROP position, DROP status, CHANGE tax_rate_id merchant_id INT NOT NULL');
$this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA568956796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
$this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA568953DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('CREATE INDEX IDX_3CA568956796D554 ON merchant_config (merchant_id)');
$this->addSql('CREATE INDEX IDX_3CA568953DA5256D ON merchant_config (image_id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA568956796D554');
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA568953DA5256D');
$this->addSql('DROP INDEX IDX_3CA568956796D554 ON merchant_config');
$this->addSql('DROP INDEX IDX_3CA568953DA5256D ON merchant_config');
$this->addSql('ALTER TABLE merchant_config ADD address_id INT DEFAULT NULL, ADD title VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD meta_title VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD meta_description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD old_urls LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\', ADD slug VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD position DOUBLE PRECISION NOT NULL, ADD status DOUBLE PRECISION NOT NULL, DROP name, CHANGE image_id credit_config_id INT DEFAULT NULL, CHANGE merchant_id tax_rate_id INT NOT NULL, CHANGE value description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA56895E511F091 FOREIGN KEY (credit_config_id) REFERENCES credit_config (id)');
$this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA56895F5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE merchant_config ADD CONSTRAINT FK_3CA56895FDD13F95 FOREIGN KEY (tax_rate_id) REFERENCES tax_rate (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3CA56895E511F091 ON merchant_config (credit_config_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3CA56895F5B7AF75 ON merchant_config (address_id)');
$this->addSql('CREATE INDEX IDX_3CA56895FDD13F95 ON merchant_config (tax_rate_id)');
}
}

+ 2
- 2
src/Entity/Merchant/MerchantConfig.php View File

@@ -2,15 +2,15 @@

namespace App\Entity\Merchant;

use Lc\CaracoleBundle\Model\Merchant\MerchantConfigModel;
use Lc\CaracoleBundle\Repository\Merchant\MerchantConfigRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantModel;

/**
* @ORM\Entity(repositoryClass=MerchantConfigRepository::class)
*/
class MerchantConfig extends MerchantModel implements MerchantInterface
class MerchantConfig extends MerchantConfigModel implements MerchantInterface
{
/**
* @ORM\Id

Loading…
Cancel
Save