Browse Source

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/CaracoleSkeleton into develop

feature/ticket
Guillaume 3 years ago
parent
commit
17590647d4
4 changed files with 88 additions and 5 deletions
  1. +35
    -0
      migrations/Version20210520093811.php
  2. +49
    -0
      migrations/Version20210603090526.php
  3. +1
    -2
      src/Controller/Admin/PageCrudController.php
  4. +3
    -3
      src/Entity/Site/Page.php

+ 35
- 0
migrations/Version20210520093811.php View File

<?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 Version20210520093811 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 parent_id INT DEFAULT NULL, DROP date_event, DROP date_time_event, DROP message, DROP show_inmenu');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620727ACA70 FOREIGN KEY (parent_id) REFERENCES page (id)');
$this->addSql('CREATE INDEX IDX_140AB620727ACA70 ON page (parent_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_140AB620727ACA70');
$this->addSql('DROP INDEX IDX_140AB620727ACA70 ON page');
$this->addSql('ALTER TABLE page ADD date_event DATE DEFAULT NULL, ADD date_time_event DATETIME DEFAULT NULL, ADD message LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD show_inmenu TINYINT(1) DEFAULT NULL, DROP parent_id');
}
}

+ 49
- 0
migrations/Version20210603090526.php View File

<?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 Version20210603090526 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 DROP FOREIGN KEY FK_140AB620727ACA70');
$this->addSql('DROP INDEX IDX_140AB620727ACA70 ON page');
$this->addSql('ALTER TABLE page ADD merchant_id INT NOT NULL, ADD content LONGTEXT DEFAULT NULL, ADD section_id INT DEFAULT NULL');
$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_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 page DROP merchant_id, DROP content, CHANGE section_id parent_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620727ACA70 FOREIGN KEY (parent_id) REFERENCES page (id)');
$this->addSql('CREATE INDEX IDX_140AB620727ACA70 ON page (parent_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');
}
}

+ 1
- 2
src/Controller/Admin/PageCrudController.php View File

use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Controller\Admin\AbstractCrudController;
use Lc\SovBundle\Field\BooleanField;
use Lc\CaracoleBundle\Controller\Admin\AbstractCrudController;
use Lc\SovBundle\Field\CKEditorField; use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\StatusField; use Lc\SovBundle\Field\StatusField;



+ 3
- 3
src/Entity/Site/Page.php View File



namespace App\Entity\Site; namespace App\Entity\Site;


use Lc\CaracoleBundle\Model\Site\PageModel;
use Lc\CaracoleBundle\Repository\Site\PageRepository;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use App\Entity\File\File ; use App\Entity\File\File ;
use Lc\CaracoleBundle\Repository\Site\PageRepository;


/** /**
* @ORM\Entity(repositoryClass=PageRepository::class) * @ORM\Entity(repositoryClass=PageRepository::class)
*/ */
class Page extends AbstractFullEntity
class Page extends PageModel
{ {
/** /**
* @ORM\Id * @ORM\Id

Loading…
Cancel
Save