Sfoglia il codice sorgente

Doctrine Fixtures

feature/ticket
Fab 3 anni fa
parent
commit
d4c034c8ba
9 ha cambiato i file con 509 aggiunte e 151 eliminazioni
  1. +1
    -0
      composer.json
  2. +159
    -1
      composer.lock
  3. +1
    -0
      config/bundles.php
  4. +0
    -53
      migrations/Version20210510094442.php
  5. +0
    -31
      migrations/Version20210603141914.php
  6. +0
    -53
      migrations/Version20210603142706.php
  7. +98
    -13
      migrations/Version20210604092848.php
  8. +235
    -0
      src/DataFixtures/CaracoleFixtures.php
  9. +15
    -0
      symfony.lock

+ 1
- 0
composer.json Vedi File

@@ -49,6 +49,7 @@
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4",
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/debug-bundle": "^5.2",

+ 159
- 1
composer.lock Vedi File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2108a57a09a39568569da93f03a4f797",
"content-hash": "a1710b4284b8b01d2e3c0fb149eab205",
"packages": [
{
"name": "artgris/filemanager-bundle",
@@ -8690,6 +8690,164 @@
}
],
"packages-dev": [
{
"name": "doctrine/data-fixtures",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/data-fixtures.git",
"reference": "51d3d4880d28951fff42a635a2389f8c63baddc5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/51d3d4880d28951fff42a635a2389f8c63baddc5",
"reference": "51d3d4880d28951fff42a635a2389f8c63baddc5",
"shasum": ""
},
"require": {
"doctrine/common": "^2.13|^3.0",
"doctrine/persistence": "^1.3.3|^2.0",
"php": "^7.2 || ^8.0"
},
"conflict": {
"doctrine/phpcr-odm": "<1.3.0"
},
"require-dev": {
"doctrine/coding-standard": "^8.2",
"doctrine/dbal": "^2.5.4",
"doctrine/mongodb-odm": "^1.3.0 || ^2.0.0",
"doctrine/orm": "^2.7.0",
"ext-sqlite3": "*",
"phpunit/phpunit": "^8.0"
},
"suggest": {
"alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)",
"doctrine/mongodb-odm": "For loading MongoDB ODM fixtures",
"doctrine/orm": "For loading ORM fixtures",
"doctrine/phpcr-odm": "For loading PHPCR ODM fixtures"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\DataFixtures\\": "lib/Doctrine/Common/DataFixtures"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Data Fixtures for all Doctrine Object Managers",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"database"
],
"support": {
"issues": "https://github.com/doctrine/data-fixtures/issues",
"source": "https://github.com/doctrine/data-fixtures/tree/1.5.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdata-fixtures",
"type": "tidelift"
}
],
"time": "2021-01-23T10:20:43+00:00"
},
{
"name": "doctrine/doctrine-fixtures-bundle",
"version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/DoctrineFixturesBundle.git",
"reference": "870189619a7770f468ffb0b80925302e065a3b34"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/870189619a7770f468ffb0b80925302e065a3b34",
"reference": "870189619a7770f468ffb0b80925302e065a3b34",
"shasum": ""
},
"require": {
"doctrine/data-fixtures": "^1.3",
"doctrine/doctrine-bundle": "^1.11|^2.0",
"doctrine/orm": "^2.6.0",
"doctrine/persistence": "^1.3.7|^2.0",
"php": "^7.1 || ^8.0",
"symfony/config": "^3.4|^4.3|^5.0",
"symfony/console": "^3.4|^4.3|^5.0",
"symfony/dependency-injection": "^3.4|^4.3|^5.0",
"symfony/doctrine-bridge": "^3.4|^4.1|^5.0",
"symfony/http-kernel": "^3.4|^4.3|^5.0"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"phpunit/phpunit": "^7.4 || ^8.0 || ^9.2",
"symfony/phpunit-bridge": "^4.1|^5.0"
},
"type": "symfony-bundle",
"autoload": {
"psr-4": {
"Doctrine\\Bundle\\FixturesBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Doctrine Project",
"homepage": "http://www.doctrine-project.org"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony DoctrineFixturesBundle",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"Fixture",
"persistence"
],
"support": {
"issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues",
"source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.4.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdoctrine-fixtures-bundle",
"type": "tidelift"
}
],
"time": "2020-11-14T09:36:49+00:00"
},
{
"name": "symfony/browser-kit",
"version": "v5.2.10",

+ 1
- 0
config/bundles.php Vedi File

@@ -20,4 +20,5 @@ return [
Artgris\Bundle\FileManagerBundle\ArtgrisFileManagerBundle::class => ['all' => true],
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
];

+ 0
- 53
migrations/Version20210510094442.php Vedi File

@@ -1,53 +0,0 @@
<?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 Version20210510094442 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('CREATE TABLE file (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, path VARCHAR(255) DEFAULT NULL, legend VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locales_enabled LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', position DOUBLE PRECISION NOT NULL, INDEX IDX_8C9F3610B03A8386 (created_by_id), INDEX IDX_8C9F3610896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE lc_translations_entity (id INT AUTO_INCREMENT NOT NULL, locale VARCHAR(8) NOT NULL, object_class VARCHAR(191) NOT NULL, field VARCHAR(32) NOT NULL, foreign_key VARCHAR(64) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX entity_translation_idx (locale, object_class, field, foreign_key), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, locales_enabled LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', INDEX IDX_140AB6203DA5256D (image_id), INDEX IDX_140AB620B03A8386 (created_by_id), INDEX IDX_140AB620896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page_file (page_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_B5B2ACAC4663E4 (page_id), INDEX IDX_B5B2ACA93CB796C (file_id), PRIMARY KEY(page_id, file_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, lastname VARCHAR(255) DEFAULT NULL, firstname VARCHAR(255) DEFAULT NULL, is_verified TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6203DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACAC4663E4 FOREIGN KEY (page_id) REFERENCES page (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACA93CB796C FOREIGN KEY (file_id) REFERENCES file (id) ON DELETE CASCADE');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6203DA5256D');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACA93CB796C');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACAC4663E4');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610B03A8386');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610896DBBDE');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620B03A8386');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620896DBBDE');
$this->addSql('DROP TABLE file');
$this->addSql('DROP TABLE lc_translations_entity');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE page_file');
$this->addSql('DROP TABLE user');
}
}

+ 0
- 31
migrations/Version20210603141914.php Vedi File

@@ -1,31 +0,0 @@
<?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 Version20210603141914 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 section ADD is_default TINYINT(1) DEFAULT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE section DROP is_default');
}
}

+ 0
- 53
migrations/Version20210603142706.php Vedi File

@@ -1,53 +0,0 @@
<?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 Version20210603142706 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 page ADD CONSTRAINT FK_140AB6206796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620D823E37A FOREIGN KEY (section_id) REFERENCES section (id)');
$this->addSql('CREATE INDEX IDX_140AB6206796D554 ON page (merchant_id)');
$this->addSql('CREATE INDEX IDX_140AB620D823E37A ON page (section_id)');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6496796D554');
$this->addSql('DROP INDEX IDX_8D93D6496796D554 ON user');
$this->addSql('ALTER TABLE user CHANGE merchant_id favorite_merchant_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649A4849017 FOREIGN KEY (favorite_merchant_id) REFERENCES merchant (id)');
$this->addSql('CREATE INDEX IDX_8D93D649A4849017 ON user (favorite_merchant_id)');
$this->addSql('ALTER TABLE user_merchant ADD current_admin_section_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_merchant ADD CONSTRAINT FK_9426C1E1FE54D809 FOREIGN KEY (current_admin_section_id) REFERENCES section (id)');
$this->addSql('CREATE INDEX IDX_9426C1E1FE54D809 ON user_merchant (current_admin_section_id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6206796D554');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620D823E37A');
$this->addSql('DROP INDEX IDX_140AB6206796D554 ON page');
$this->addSql('DROP INDEX IDX_140AB620D823E37A ON page');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649A4849017');
$this->addSql('DROP INDEX IDX_8D93D649A4849017 ON user');
$this->addSql('ALTER TABLE user CHANGE favorite_merchant_id merchant_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6496796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
$this->addSql('CREATE INDEX IDX_8D93D6496796D554 ON user (merchant_id)');
$this->addSql('ALTER TABLE user_merchant DROP FOREIGN KEY FK_9426C1E1FE54D809');
$this->addSql('DROP INDEX IDX_9426C1E1FE54D809 ON user_merchant');
$this->addSql('ALTER TABLE user_merchant DROP current_admin_section_id');
}
}

migrations/Version20210511094837.php → migrations/Version20210604092848.php Vedi File

@@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210511094837 extends AbstractMigration
final class Version20210604092848 extends AbstractMigration
{
public function getDescription(): string
{
@@ -24,6 +24,7 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('CREATE TABLE credit_config (id INT AUTO_INCREMENT NOT NULL, active TINYINT(1) NOT NULL, limit_amount DOUBLE PRECISION DEFAULT NULL, limit_reminder DOUBLE PRECISION DEFAULT NULL, behavior VARCHAR(31) DEFAULT NULL, process_order_checked_default TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE credit_history (id INT AUTO_INCREMENT NOT NULL, user_merchant_id INT NOT NULL, order_payment_id INT DEFAULT NULL, order_refund_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, amount DOUBLE PRECISION DEFAULT NULL, type VARCHAR(31) NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mean_payment VARCHAR(255) DEFAULT NULL, reference LONGTEXT DEFAULT NULL, paid_at DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, INDEX IDX_1D3E1764CE8D1CC1 (user_merchant_id), UNIQUE INDEX UNIQ_1D3E1764B7195EEE (order_payment_id), UNIQUE INDEX UNIQ_1D3E1764A41F7A2D (order_refund_id), INDEX IDX_1D3E1764B03A8386 (created_by_id), INDEX IDX_1D3E1764896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE document (id INT AUTO_INCREMENT NOT NULL, merchant_id INT NOT NULL, merchant_address_id INT NOT NULL, buyer_address_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, type VARCHAR(64) NOT NULL, reference VARCHAR(128) DEFAULT NULL, logo VARCHAR(255) DEFAULT NULL, merchant_address_text LONGTEXT NOT NULL, buyer_address_text LONGTEXT DEFAULT NULL, delivery_address_text LONGTEXT DEFAULT NULL, is_sent TINYINT(1) DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_D8698A766796D554 (merchant_id), INDEX IDX_D8698A7697D868A5 (merchant_address_id), INDEX IDX_D8698A7656E5354 (buyer_address_id), INDEX IDX_D8698A76B03A8386 (created_by_id), INDEX IDX_D8698A76896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE file (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, path VARCHAR(255) DEFAULT NULL, legend VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locales_enabled LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', position DOUBLE PRECISION NOT NULL, INDEX IDX_8C9F3610B03A8386 (created_by_id), INDEX IDX_8C9F3610896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE group_user (id INT AUTO_INCREMENT NOT NULL, merchant_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_A4C98D396796D554 (merchant_id), INDEX IDX_A4C98D39B03A8386 (created_by_id), INDEX IDX_A4C98D39896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE merchant (id INT AUTO_INCREMENT NOT NULL, credit_config_id INT DEFAULT NULL, tax_rate_id INT NOT NULL, address_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_74AB25E1E511F091 (credit_config_id), INDEX IDX_74AB25E1FDD13F95 (tax_rate_id), UNIQUE INDEX UNIQ_74AB25E1F5B7AF75 (address_id), INDEX IDX_74AB25E1B03A8386 (created_by_id), INDEX IDX_74AB25E1896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE merchant_config (id INT AUTO_INCREMENT NOT NULL, credit_config_id INT DEFAULT NULL, tax_rate_id INT NOT NULL, address_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_3CA56895E511F091 (credit_config_id), INDEX IDX_3CA56895FDD13F95 (tax_rate_id), UNIQUE INDEX UNIQ_3CA56895F5B7AF75 (address_id), INDEX IDX_3CA56895B03A8386 (created_by_id), INDEX IDX_3CA56895896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
@@ -41,6 +42,8 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('CREATE TABLE order_status (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, alias VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE order_status_order_status_interface (order_status_id INT NOT NULL, order_status_interface_id INT NOT NULL, INDEX IDX_31CB58CAD7707B45 (order_status_id), INDEX IDX_31CB58CAAEF3C90F (order_status_interface_id), PRIMARY KEY(order_status_id, order_status_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE order_status_history (id INT AUTO_INCREMENT NOT NULL, order_shop_id INT NOT NULL, order_status_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, origin VARCHAR(31) NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_471AD77EBB6C6D96 (order_shop_id), INDEX IDX_471AD77ED7707B45 (order_status_id), INDEX IDX_471AD77EB03A8386 (created_by_id), INDEX IDX_471AD77E896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, merchant_id INT NOT NULL, section_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, content LONGTEXT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_140AB6203DA5256D (image_id), INDEX IDX_140AB6206796D554 (merchant_id), INDEX IDX_140AB620D823E37A (section_id), INDEX IDX_140AB620B03A8386 (created_by_id), INDEX IDX_140AB620896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page_file (page_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_B5B2ACAC4663E4 (page_id), INDEX IDX_B5B2ACA93CB796C (file_id), PRIMARY KEY(page_id, file_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE point_sale (id INT AUTO_INCREMENT NOT NULL, address_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, code VARCHAR(63) DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, order_amount_min DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_6CCB2767F5B7AF75 (address_id), INDEX IDX_6CCB2767B03A8386 (created_by_id), INDEX IDX_6CCB2767896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE point_sale_merchant_interface (point_sale_id INT NOT NULL, merchant_interface_id INT NOT NULL, INDEX IDX_7711E325FDAAB1A4 (point_sale_id), INDEX IDX_7711E3252F3319E1 (merchant_interface_id), PRIMARY KEY(point_sale_id, merchant_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE point_sale_day_info (id INT AUTO_INCREMENT NOT NULL, point_sale_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, active TINYINT(1) NOT NULL, day SMALLINT NOT NULL, description LONGTEXT DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_34BC1A33FDAAB1A4 (point_sale_id), INDEX IDX_34BC1A33B03A8386 (created_by_id), INDEX IDX_34BC1A33896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
@@ -63,15 +66,16 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('CREATE TABLE reduction_credit_user_interface (reduction_credit_id INT NOT NULL, user_interface_id INT NOT NULL, INDEX IDX_1E04D3826103B276 (reduction_credit_id), INDEX IDX_1E04D3822BC79580 (user_interface_id), PRIMARY KEY(reduction_credit_id, user_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE reminder (id INT AUTO_INCREMENT NOT NULL, merchant_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, entity_name VARCHAR(255) DEFAULT NULL, entity_id INT DEFAULT NULL, entity_action VARCHAR(255) DEFAULT NULL, date_reminder DATE DEFAULT NULL, done TINYINT(1) NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_40374F406796D554 (merchant_id), INDEX IDX_40374F40B03A8386 (created_by_id), INDEX IDX_40374F40896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE reminder_user_interface (reminder_id INT NOT NULL, user_interface_id INT NOT NULL, INDEX IDX_7FD2584BD987BE75 (reminder_id), INDEX IDX_7FD2584B2BC79580 (user_interface_id), PRIMARY KEY(reminder_id, user_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE section (id INT AUTO_INCREMENT NOT NULL, merchant_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, cycle VARCHAR(32) NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_2D737AEF6796D554 (merchant_id), INDEX IDX_2D737AEFB03A8386 (created_by_id), INDEX IDX_2D737AEF896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE section (id INT AUTO_INCREMENT NOT NULL, merchant_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, cycle VARCHAR(32) NOT NULL, is_default TINYINT(1) DEFAULT NULL, color VARCHAR(32) NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_2D737AEF6796D554 (merchant_id), INDEX IDX_2D737AEFB03A8386 (created_by_id), INDEX IDX_2D737AEF896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tax_rate (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, value DOUBLE PRECISION NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_C36330C1B03A8386 (created_by_id), INDEX IDX_C36330C1896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ticket (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, merchant_id INT NOT NULL, order_shop_id INT DEFAULT NULL, user_id INT DEFAULT NULL, type VARCHAR(32) NOT NULL, status VARCHAR(32) NOT NULL, subject VARCHAR(255) NOT NULL, tags LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', visitor_firstname VARCHAR(64) DEFAULT NULL, visitor_lastname VARCHAR(64) DEFAULT NULL, visitor_email VARCHAR(128) DEFAULT NULL, visitor_token VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_97A0ADA3B03A8386 (created_by_id), INDEX IDX_97A0ADA3896DBBDE (updated_by_id), INDEX IDX_97A0ADA36796D554 (merchant_id), INDEX IDX_97A0ADA3BB6C6D96 (order_shop_id), INDEX IDX_97A0ADA3A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ticket_message (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, ticket_id INT NOT NULL, message LONGTEXT NOT NULL, answer_by_admin TINYINT(1) DEFAULT NULL, image_filename VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, status DOUBLE PRECISION NOT NULL, INDEX IDX_BA71692DB03A8386 (created_by_id), INDEX IDX_BA71692D896DBBDE (updated_by_id), INDEX IDX_BA71692D700047D2 (ticket_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE unit (id INT AUTO_INCREMENT NOT NULL, unit_reference_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, unit VARCHAR(32) NOT NULL, wording VARCHAR(32) NOT NULL, wording_unit VARCHAR(32) NOT NULL, wording_short VARCHAR(32) NOT NULL, coefficient INT NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_DCBB0C53C4D33C3E (unit_reference_id), INDEX IDX_DCBB0C53B03A8386 (created_by_id), INDEX IDX_DCBB0C53896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, favorite_merchant_id INT DEFAULT NULL, phone VARCHAR(20) DEFAULT NULL, behavior_display_price VARCHAR(64) DEFAULT NULL, firstname VARCHAR(64) DEFAULT NULL, lastname VARCHAR(64) DEFAULT NULL, gender TINYINT(1) DEFAULT NULL, ticket_types_notification LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, is_verified TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), INDEX IDX_8D93D649A4849017 (favorite_merchant_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_newsletter_interface (user_id INT NOT NULL, newsletter_interface_id INT NOT NULL, INDEX IDX_276FB522A76ED395 (user_id), INDEX IDX_276FB522A0E6D8FC (newsletter_interface_id), PRIMARY KEY(user_id, newsletter_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_group_user_interface (user_id INT NOT NULL, group_user_interface_id INT NOT NULL, INDEX IDX_12B87B34A76ED395 (user_id), INDEX IDX_12B87B34F583BABC (group_user_interface_id), PRIMARY KEY(user_id, group_user_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_product_family_interface (user_id INT NOT NULL, product_family_interface_id INT NOT NULL, INDEX IDX_6F63A287A76ED395 (user_id), INDEX IDX_6F63A2874537D78D (product_family_interface_id), PRIMARY KEY(user_id, product_family_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_merchant (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, merchant_id INT NOT NULL, credit DOUBLE PRECISION DEFAULT NULL, credit_active TINYINT(1) NOT NULL, active TINYINT(1) NOT NULL, INDEX IDX_9426C1E1A76ED395 (user_id), INDEX IDX_9426C1E16796D554 (merchant_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_merchant (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, merchant_id INT NOT NULL, current_admin_section_id INT DEFAULT NULL, credit DOUBLE PRECISION DEFAULT NULL, credit_active TINYINT(1) NOT NULL, active TINYINT(1) NOT NULL, INDEX IDX_9426C1E1A76ED395 (user_id), INDEX IDX_9426C1E16796D554 (merchant_id), INDEX IDX_9426C1E1FE54D809 (current_admin_section_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_point_sale (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, point_sale_id INT NOT NULL, comment LONGTEXT DEFAULT NULL, INDEX IDX_CBACE18BA76ED395 (user_id), INDEX IDX_CBACE18BFDAAB1A4 (point_sale_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE visitor (id INT AUTO_INCREMENT NOT NULL, cookie VARCHAR(255) NOT NULL, last_access DATETIME NOT NULL, ip VARCHAR(255) NOT NULL, total_visit INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE address ADD CONSTRAINT FK_D4E6F81A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
@@ -87,6 +91,8 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A7656E5354 FOREIGN KEY (buyer_address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D396796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
@@ -139,6 +145,13 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE order_status_history ADD CONSTRAINT FK_471AD77ED7707B45 FOREIGN KEY (order_status_id) REFERENCES order_status (id)');
$this->addSql('ALTER TABLE order_status_history ADD CONSTRAINT FK_471AD77EB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE order_status_history ADD CONSTRAINT FK_471AD77E896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6203DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6206796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620D823E37A FOREIGN KEY (section_id) REFERENCES section (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACAC4663E4 FOREIGN KEY (page_id) REFERENCES page (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACA93CB796C FOREIGN KEY (file_id) REFERENCES file (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE point_sale ADD CONSTRAINT FK_6CCB2767F5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE point_sale ADD CONSTRAINT FK_6CCB2767B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE point_sale ADD CONSTRAINT FK_6CCB2767896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
@@ -216,6 +229,7 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE unit ADD CONSTRAINT FK_DCBB0C53C4D33C3E FOREIGN KEY (unit_reference_id) REFERENCES unit (id)');
$this->addSql('ALTER TABLE unit ADD CONSTRAINT FK_DCBB0C53B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE unit ADD CONSTRAINT FK_DCBB0C53896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649A4849017 FOREIGN KEY (favorite_merchant_id) REFERENCES merchant (id)');
$this->addSql('ALTER TABLE user_newsletter_interface ADD CONSTRAINT FK_276FB522A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_newsletter_interface ADD CONSTRAINT FK_276FB522A0E6D8FC FOREIGN KEY (newsletter_interface_id) REFERENCES newsletter (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_group_user_interface ADD CONSTRAINT FK_12B87B34A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
@@ -224,13 +238,9 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE user_product_family_interface ADD CONSTRAINT FK_6F63A2874537D78D FOREIGN KEY (product_family_interface_id) REFERENCES product_family (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_merchant ADD CONSTRAINT FK_9426C1E1A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user_merchant ADD CONSTRAINT FK_9426C1E16796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
$this->addSql('ALTER TABLE user_merchant ADD CONSTRAINT FK_9426C1E1FE54D809 FOREIGN KEY (current_admin_section_id) REFERENCES section (id)');
$this->addSql('ALTER TABLE user_point_sale ADD CONSTRAINT FK_CBACE18BA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user_point_sale ADD CONSTRAINT FK_CBACE18BFDAAB1A4 FOREIGN KEY (point_sale_id) REFERENCES point_sale (id)');
$this->addSql('DROP TABLE lc_translations_entity');
$this->addSql('ALTER TABLE page DROP locales_enabled');
$this->addSql('ALTER TABLE user ADD merchant_id INT DEFAULT NULL, ADD phone VARCHAR(20) DEFAULT NULL, ADD behavior_display_price VARCHAR(64) DEFAULT NULL, ADD gender TINYINT(1) DEFAULT NULL, ADD ticket_types_notification LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6496796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
$this->addSql('CREATE INDEX IDX_8D93D6496796D554 ON user (merchant_id)');
}

public function down(Schema $schema): void
@@ -246,6 +256,8 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895E511F091');
$this->addSql('ALTER TABLE order_refund DROP FOREIGN KEY FK_98A3048DC33F7837');
$this->addSql('ALTER TABLE order_shop_document_interface DROP FOREIGN KEY FK_3C004E66EEC8F3');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6203DA5256D');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACA93CB796C');
$this->addSql('ALTER TABLE reduction_cart_group_user_interface DROP FOREIGN KEY FK_16258520F583BABC');
$this->addSql('ALTER TABLE reduction_catalog_group_user_interface DROP FOREIGN KEY FK_32F80FA3F583BABC');
$this->addSql('ALTER TABLE user_group_user_interface DROP FOREIGN KEY FK_12B87B34F583BABC');
@@ -254,6 +266,7 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE news DROP FOREIGN KEY FK_1DD399506796D554');
$this->addSql('ALTER TABLE newsletter DROP FOREIGN KEY FK_7E8585C86796D554');
$this->addSql('ALTER TABLE order_shop DROP FOREIGN KEY FK_E19B76B56796D554');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6206796D554');
$this->addSql('ALTER TABLE point_sale_merchant_interface DROP FOREIGN KEY FK_7711E3252F3319E1');
$this->addSql('ALTER TABLE product_category DROP FOREIGN KEY FK_CDFC73566796D554');
$this->addSql('ALTER TABLE product_family DROP FOREIGN KEY FK_C79A60FF6796D554');
@@ -263,7 +276,7 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F406796D554');
$this->addSql('ALTER TABLE section DROP FOREIGN KEY FK_2D737AEF6796D554');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA36796D554');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6496796D554');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649A4849017');
$this->addSql('ALTER TABLE user_merchant DROP FOREIGN KEY FK_9426C1E16796D554');
$this->addSql('ALTER TABLE user_newsletter_interface DROP FOREIGN KEY FK_276FB522A0E6D8FC');
$this->addSql('ALTER TABLE credit_history DROP FOREIGN KEY FK_1D3E1764B7195EEE');
@@ -282,6 +295,7 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE order_status_order_status_interface DROP FOREIGN KEY FK_31CB58CAD7707B45');
$this->addSql('ALTER TABLE order_status_order_status_interface DROP FOREIGN KEY FK_31CB58CAAEF3C90F');
$this->addSql('ALTER TABLE order_status_history DROP FOREIGN KEY FK_471AD77ED7707B45');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACAC4663E4');
$this->addSql('ALTER TABLE point_sale_merchant_interface DROP FOREIGN KEY FK_7711E325FDAAB1A4');
$this->addSql('ALTER TABLE point_sale_day_info DROP FOREIGN KEY FK_34BC1A33FDAAB1A4');
$this->addSql('ALTER TABLE reduction_cart_point_sale_interface DROP FOREIGN KEY FK_7DA5ED38A72A2A90');
@@ -310,8 +324,10 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE reduction_credit_user_interface DROP FOREIGN KEY FK_1E04D3826103B276');
$this->addSql('ALTER TABLE reminder_user_interface DROP FOREIGN KEY FK_7FD2584BD987BE75');
$this->addSql('ALTER TABLE order_shop DROP FOREIGN KEY FK_E19B76B5D823E37A');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620D823E37A');
$this->addSql('ALTER TABLE product_category DROP FOREIGN KEY FK_CDFC7356D823E37A');
$this->addSql('ALTER TABLE product_family_section_interface DROP FOREIGN KEY FK_2991468D6BA77450');
$this->addSql('ALTER TABLE user_merchant DROP FOREIGN KEY FK_9426C1E1FE54D809');
$this->addSql('ALTER TABLE merchant DROP FOREIGN KEY FK_74AB25E1FDD13F95');
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895FDD13F95');
$this->addSql('ALTER TABLE order_product DROP FOREIGN KEY FK_2530ADE6FDD13F95');
@@ -322,13 +338,82 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADF8BD700D');
$this->addSql('ALTER TABLE product_family DROP FOREIGN KEY FK_C79A60FFF8BD700D');
$this->addSql('ALTER TABLE unit DROP FOREIGN KEY FK_DCBB0C53C4D33C3E');
$this->addSql('ALTER TABLE address DROP FOREIGN KEY FK_D4E6F81A76ED395');
$this->addSql('ALTER TABLE address DROP FOREIGN KEY FK_D4E6F81B03A8386');
$this->addSql('ALTER TABLE address DROP FOREIGN KEY FK_D4E6F81896DBBDE');
$this->addSql('ALTER TABLE credit_history DROP FOREIGN KEY FK_1D3E1764B03A8386');
$this->addSql('ALTER TABLE credit_history DROP FOREIGN KEY FK_1D3E1764896DBBDE');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY FK_D8698A76B03A8386');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY FK_D8698A76896DBBDE');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610B03A8386');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610896DBBDE');
$this->addSql('ALTER TABLE group_user DROP FOREIGN KEY FK_A4C98D39B03A8386');
$this->addSql('ALTER TABLE group_user DROP FOREIGN KEY FK_A4C98D39896DBBDE');
$this->addSql('ALTER TABLE merchant DROP FOREIGN KEY FK_74AB25E1B03A8386');
$this->addSql('ALTER TABLE merchant DROP FOREIGN KEY FK_74AB25E1896DBBDE');
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895B03A8386');
$this->addSql('ALTER TABLE merchant_config DROP FOREIGN KEY FK_3CA56895896DBBDE');
$this->addSql('ALTER TABLE news DROP FOREIGN KEY FK_1DD39950B03A8386');
$this->addSql('ALTER TABLE news DROP FOREIGN KEY FK_1DD39950896DBBDE');
$this->addSql('ALTER TABLE newsletter DROP FOREIGN KEY FK_7E8585C8B03A8386');
$this->addSql('ALTER TABLE newsletter DROP FOREIGN KEY FK_7E8585C8896DBBDE');
$this->addSql('ALTER TABLE order_payment DROP FOREIGN KEY FK_9B522D46B03A8386');
$this->addSql('ALTER TABLE order_payment DROP FOREIGN KEY FK_9B522D46896DBBDE');
$this->addSql('ALTER TABLE order_refund DROP FOREIGN KEY FK_98A3048DB03A8386');
$this->addSql('ALTER TABLE order_refund DROP FOREIGN KEY FK_98A3048D896DBBDE');
$this->addSql('ALTER TABLE order_shop DROP FOREIGN KEY FK_E19B76B5A76ED395');
$this->addSql('ALTER TABLE order_shop DROP FOREIGN KEY FK_E19B76B5B03A8386');
$this->addSql('ALTER TABLE order_shop DROP FOREIGN KEY FK_E19B76B5896DBBDE');
$this->addSql('ALTER TABLE order_status_history DROP FOREIGN KEY FK_471AD77EB03A8386');
$this->addSql('ALTER TABLE order_status_history DROP FOREIGN KEY FK_471AD77E896DBBDE');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620B03A8386');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620896DBBDE');
$this->addSql('ALTER TABLE point_sale DROP FOREIGN KEY FK_6CCB2767B03A8386');
$this->addSql('ALTER TABLE point_sale DROP FOREIGN KEY FK_6CCB2767896DBBDE');
$this->addSql('ALTER TABLE point_sale_day_info DROP FOREIGN KEY FK_34BC1A33B03A8386');
$this->addSql('ALTER TABLE point_sale_day_info DROP FOREIGN KEY FK_34BC1A33896DBBDE');
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADB03A8386');
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04AD896DBBDE');
$this->addSql('ALTER TABLE product_category DROP FOREIGN KEY FK_CDFC7356B03A8386');
$this->addSql('ALTER TABLE product_category DROP FOREIGN KEY FK_CDFC7356896DBBDE');
$this->addSql('ALTER TABLE product_family DROP FOREIGN KEY FK_C79A60FFB03A8386');
$this->addSql('ALTER TABLE product_family DROP FOREIGN KEY FK_C79A60FF896DBBDE');
$this->addSql('ALTER TABLE reduction_cart DROP FOREIGN KEY FK_EAD80509B03A8386');
$this->addSql('ALTER TABLE reduction_cart DROP FOREIGN KEY FK_EAD80509896DBBDE');
$this->addSql('ALTER TABLE reduction_cart_user_interface DROP FOREIGN KEY FK_4BFD6F362BC79580');
$this->addSql('ALTER TABLE reduction_catalog DROP FOREIGN KEY FK_9D16AF0EB03A8386');
$this->addSql('ALTER TABLE reduction_catalog DROP FOREIGN KEY FK_9D16AF0E896DBBDE');
$this->addSql('ALTER TABLE reduction_catalog_user_interface DROP FOREIGN KEY FK_FB0FFDFA2BC79580');
$this->addSql('ALTER TABLE reduction_credit DROP FOREIGN KEY FK_F58EF32E7E3C61F9');
$this->addSql('ALTER TABLE reduction_credit DROP FOREIGN KEY FK_F58EF32EB03A8386');
$this->addSql('ALTER TABLE reduction_credit DROP FOREIGN KEY FK_F58EF32E896DBBDE');
$this->addSql('ALTER TABLE reduction_credit_user_interface DROP FOREIGN KEY FK_1E04D3822BC79580');
$this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F40B03A8386');
$this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F40896DBBDE');
$this->addSql('ALTER TABLE reminder_user_interface DROP FOREIGN KEY FK_7FD2584B2BC79580');
$this->addSql('ALTER TABLE section DROP FOREIGN KEY FK_2D737AEFB03A8386');
$this->addSql('ALTER TABLE section DROP FOREIGN KEY FK_2D737AEF896DBBDE');
$this->addSql('ALTER TABLE tax_rate DROP FOREIGN KEY FK_C36330C1B03A8386');
$this->addSql('ALTER TABLE tax_rate DROP FOREIGN KEY FK_C36330C1896DBBDE');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3B03A8386');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3896DBBDE');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3A76ED395');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692DB03A8386');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D896DBBDE');
$this->addSql('ALTER TABLE unit DROP FOREIGN KEY FK_DCBB0C53B03A8386');
$this->addSql('ALTER TABLE unit DROP FOREIGN KEY FK_DCBB0C53896DBBDE');
$this->addSql('ALTER TABLE user_newsletter_interface DROP FOREIGN KEY FK_276FB522A76ED395');
$this->addSql('ALTER TABLE user_group_user_interface DROP FOREIGN KEY FK_12B87B34A76ED395');
$this->addSql('ALTER TABLE user_product_family_interface DROP FOREIGN KEY FK_6F63A287A76ED395');
$this->addSql('ALTER TABLE user_merchant DROP FOREIGN KEY FK_9426C1E1A76ED395');
$this->addSql('ALTER TABLE user_point_sale DROP FOREIGN KEY FK_CBACE18BA76ED395');
$this->addSql('ALTER TABLE credit_history DROP FOREIGN KEY FK_1D3E1764CE8D1CC1');
$this->addSql('ALTER TABLE order_shop DROP FOREIGN KEY FK_E19B76B570BEE6D');
$this->addSql('CREATE TABLE lc_translations_entity (id INT AUTO_INCREMENT NOT NULL, locale VARCHAR(8) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, field VARCHAR(32) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, content LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX entity_translation_idx (locale, object_class, field, foreign_key), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('DROP TABLE address');
$this->addSql('DROP TABLE credit_config');
$this->addSql('DROP TABLE credit_history');
$this->addSql('DROP TABLE document');
$this->addSql('DROP TABLE file');
$this->addSql('DROP TABLE group_user');
$this->addSql('DROP TABLE merchant');
$this->addSql('DROP TABLE merchant_config');
@@ -346,6 +431,8 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('DROP TABLE order_status');
$this->addSql('DROP TABLE order_status_order_status_interface');
$this->addSql('DROP TABLE order_status_history');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE page_file');
$this->addSql('DROP TABLE point_sale');
$this->addSql('DROP TABLE point_sale_merchant_interface');
$this->addSql('DROP TABLE point_sale_day_info');
@@ -373,14 +460,12 @@ final class Version20210511094837 extends AbstractMigration
$this->addSql('DROP TABLE ticket');
$this->addSql('DROP TABLE ticket_message');
$this->addSql('DROP TABLE unit');
$this->addSql('DROP TABLE user');
$this->addSql('DROP TABLE user_newsletter_interface');
$this->addSql('DROP TABLE user_group_user_interface');
$this->addSql('DROP TABLE user_product_family_interface');
$this->addSql('DROP TABLE user_merchant');
$this->addSql('DROP TABLE user_point_sale');
$this->addSql('DROP TABLE visitor');
$this->addSql('ALTER TABLE page ADD locales_enabled LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\'');
$this->addSql('DROP INDEX IDX_8D93D6496796D554 ON user');
$this->addSql('ALTER TABLE user DROP merchant_id, DROP phone, DROP behavior_display_price, DROP gender, DROP ticket_types_notification, CHANGE firstname firstname VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE lastname lastname VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
}
}

+ 235
- 0
src/DataFixtures/CaracoleFixtures.php Vedi File

@@ -0,0 +1,235 @@
<?php
/**
* @author La clic ! <contact@laclic.fr>
*/

namespace App\DataFixtures;


use App\Entity\Config\TaxRate;
use App\Entity\Config\Unit;
use App\Entity\Merchant\Merchant;
use App\Entity\Section\Section;
use App\Entity\User\User;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectManager;
use Lc\SovBundle\Model\User\UserInterface;

class CaracoleFixtures extends Fixture
{
protected $em;
public function __construct(EntityManagerInterface $entityManager){
$this->em = $entityManager;
}
public function load(ObjectManager $manager)
{
$fab = $this->createUserFab();
$gui = $this->createUserGui();

foreach (self::$unitsArray as $unit => $unitInfos) {
$unitEntity = new Unit();
$unitEntity->setUnit($unitInfos['unit'])
->setWording($unitInfos['wording'])
->setWordingUnit($unitInfos['wording_unit'])
->setWordingShort($unitInfos['wording_short'])
->setCoefficient($unitInfos['coefficient'])
->setCreatedBy($gui)
->setUpdatedBy($gui);
self::$unitsArray[$unit]['entity'] = $unitEntity;
}
foreach (self::$unitsArray as $unit => $unitInfos) {
self::$unitsArray[$unit]['entity']->setUnitReference(self::$unitsArray[$unitInfos['ref']]['entity']);
$this->em->persist(self::$unitsArray[$unit]['entity']);
}

$taxRate = new TaxRate();
$taxRate->setTitle('FR Taux standard (20%)');
$taxRate->setValue(20);

$taxRate1 = new TaxRate();
$taxRate1->setTitle('FR Taux réduit (10%)');
$taxRate1->setValue(10);

$taxRate2 = new TaxRate();
$taxRate2->setTitle('FR Taux réduit (5.5%)');
$taxRate2->setValue(5.5);


$taxRate3 = new TaxRate();
$taxRate3->setTitle('FR Taux super réduit (2.1%)');
$taxRate3->setValue(2.1);

$hubBelfort = new Merchant();
$hubBelfort->setTitle('Belfort - Montbéliard');
$hubBelfort->setTaxRate($taxRate2);

$hubBesac = new Merchant();
$hubBesac->setTitle('Besançon');
$hubBesac->setTaxRate($taxRate2);

$this->createSessionsBesak($hubBesac, $fab);
$this->createSectionBelfort($hubBelfort, $fab);

$taxRate->setCreatedBy($fab)->setUpdatedBy($fab);
$taxRate1->setCreatedBy($fab)->setUpdatedBy($fab);
$taxRate2->setCreatedBy($fab)->setUpdatedBy($fab);
$taxRate3->setCreatedBy($fab)->setUpdatedBy($fab);
$hubBelfort->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1);
$hubBesac->setCreatedBy($fab)->setUpdatedBy($fab)->setStatus(1);


$this->em->persist($fab);
$this->em->persist($gui);
$this->em->persist($taxRate);
$this->em->persist($taxRate1);
$this->em->persist($taxRate2);
$this->em->persist($taxRate3);
$this->em->persist($hubBelfort);
$this->em->persist($hubBesac);


$manager->flush();
}


protected function createSectionBelfort($hubBelfort, $user){
$sectionBelfort[0] = new Section();
$sectionBelfort[0]->setTitle('Marché');
$sectionBelfort[0]->setStatus(1);
$sectionBelfort[0]->setIsDefault(true);
$sectionBelfort[0]->setColor('#F9DC5C');
$sectionBelfort[0]->setCycle(Section::CYCLE_WEEK);
$sectionBelfort[0]->setMerchant($hubBelfort);
$sectionBelfort[0]->setCreatedBy($user)->setUpdatedBy($user);

$sectionBelfort[1] = new Section();
$sectionBelfort[1]->setTitle('Repas midi');
$sectionBelfort[1]->setStatus(1);
$sectionBelfort[1]->setColor('#ED254E');
$sectionBelfort[1]->setCycle(Section::CYCLE_DAY);
$sectionBelfort[1]->setMerchant($hubBelfort);
$sectionBelfort[1]->setCreatedBy($user)->setUpdatedBy($user);


$sectionBelfort[2] = new Section();
$sectionBelfort[2]->setTitle('Retrait jounrée');
$sectionBelfort[2]->setStatus(1);
$sectionBelfort[2]->setColor('#94C9A9');
$sectionBelfort[2]->setCycle(Section::CYCLE_DAY);
$sectionBelfort[2]->setMerchant($hubBelfort);
$sectionBelfort[2]->setCreatedBy($user)->setUpdatedBy($user);

$sectionBelfort[3] = new Section();
$sectionBelfort[3]->setTitle('Espace Pro');
$sectionBelfort[3]->setStatus(1);
$sectionBelfort[3]->setColor('#464655');
$sectionBelfort[3]->setCycle(Section::CYCLE_WEEK);
$sectionBelfort[3]->setMerchant($hubBelfort);
$sectionBelfort[3]->setCreatedBy($user)->setUpdatedBy($user);

$this->em->persist($sectionBelfort[0]);
$this->em->persist($sectionBelfort[1]);
$this->em->persist($sectionBelfort[2]);
$this->em->persist($sectionBelfort[3]);

return $sectionBelfort;
}

protected function createSessionsBesak($hubBesak, $user){
$sectionBesac = new Section();
$sectionBesac->setTitle('Marché');
$sectionBesac->setStatus(1);
$sectionBesac->setIsDefault(true);

$sectionBesac->setColor('#F9DC5C');
$sectionBesac->setCycle(Section::CYCLE_WEEK);
$sectionBesac->setMerchant($hubBesak);
$sectionBesac->setCreatedBy($user)->setUpdatedBy($user);

$this->em->persist($sectionBesac);

return $sectionBesac;
}

protected
function createUserFab()
{
$fab = new User();
$fab->setEmail('fab@laclic.fr');
$fab->setLastname('Normand');
$fab->setFirstname('Fab');
$fab->setPassword('$2y$13$ExSKxXX8bQ20fBocZrUAJugov2MfE2x14BxsQaVyODsousxPWS2gS');
$fab->setRoles(array('ROLE_ADMIN', 'ROLE_SUPER_ADMIN'));
return $fab;
}

protected
function createUserGui()
{
$gui = new User();
$gui->setEmail('guillaume@laclic.fr');
$gui->setLastname('Bourgeois');
$gui->setFirstname('Guillaume');
$gui->setPassword('$2y$13$sGqcr64Cdhg8bRs744Ry..ub/Pi6uzpPMfBxdjCdenOXV5fFZ4TA.');

$gui->setRoles(array('ROLE_ADMIN', 'ROLE_SUPER_ADMIN'));
return $gui;
}




public static $unitsArray = [
'piece' => [
'unit' => 'piece',
'wording_unit' => 'la pièce',
'wording' => 'pièce(s)',
'wording_short' => 'p.',
'coefficient' => 1,
'ref' => 'piece'
],
'g' => [
'unit' => 'g',
'wording_unit' => 'le g',
'wording' => 'g',
'wording_short' => 'g',
'coefficient' => 1000,
'ref' => 'kg'
],
'kg' => [
'unit' => 'kg',
'wording_unit' => 'le kg',
'wording' => 'kg',
'wording_short' => 'kg',
'coefficient' => 1,
'ref' => 'kg'
],
'mL' => [
'unit' => 'mL',
'wording_unit' => 'le mL',
'wording' => 'mL',
'wording_short' => 'mL',
'coefficient' => 1000,
'ref' => 'L'
],
'cL' => [
'unit' => 'cL',
'wording_unit' => 'le cL',
'wording' => 'cL',
'wording_short' => 'cL',
'coefficient' => 100,
'ref' => 'L'
],
'L' => [
'unit' => 'L',
'wording_unit' => 'le litre',
'wording' => 'L',
'wording_short' => 'L',
'coefficient' => 1,
'ref' => 'L'
],
];


}

+ 15
- 0
symfony.lock Vedi File

@@ -32,6 +32,9 @@
"doctrine/common": {
"version": "3.1.2"
},
"doctrine/data-fixtures": {
"version": "1.5.0"
},
"doctrine/dbal": {
"version": "2.13.1"
},
@@ -54,6 +57,18 @@
"src/Repository/.gitignore"
]
},
"doctrine/doctrine-fixtures-bundle": {
"version": "3.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.0",
"ref": "e5b542d4ef47d8a003c91beb35650c76907f7e53"
},
"files": [
"src/DataFixtures/AppFixtures.php"
]
},
"doctrine/doctrine-migrations-bundle": {
"version": "3.1",
"recipe": {

Loading…
Annulla
Salva