Skip to content

Commit

Permalink
Persoo article fixes (#2972)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-rostislav authored Jan 8, 2024
2 parents f6b9059 + 733cc12 commit caac8e1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"stof/doctrine-extensions-bundle": "^1.3.0",
"symfony/error-handler": "^5.4",
"symfony/event-dispatcher": "^5.4",
"symfony/html-sanitizer": "^6.1.0",
"symfony/mailer": "^5.4",
"symfony/messenger": "^5.4",
"symfony/monolog-bundle": "^3.5.0",
Expand Down
57 changes: 57 additions & 0 deletions src/Migrations/Version20240105155555.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

namespace Shopsys\FrameworkBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration;

class Version20240105155555 extends AbstractMigration
{
/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function up(Schema $schema): void
{
if ($this->isAppMigrationNotInstalledRemoveIfExists('Version20210709155038')) {
$this->sql('ALTER TABLE blog_categories ADD uuid UUID DEFAULT NULL');
$this->sql('UPDATE blog_categories SET uuid = uuid_generate_v4()');
$this->sql('ALTER TABLE blog_categories ALTER uuid SET NOT NULL');
$this->sql('CREATE UNIQUE INDEX UNIQ_DC356481D17F50A6 ON blog_categories (uuid)');
}

if ($this->isAppMigrationNotInstalledRemoveIfExists('Version20230313113336')) {
$this->sql('DROP TABLE blog_article_products');
}

if ($this->isAppMigrationNotInstalledRemoveIfExists('Version20210611150732')) {
$this->sql('ALTER TABLE blog_articles ADD uuid UUID DEFAULT NULL');
$this->sql('UPDATE blog_articles SET uuid = uuid_generate_v4()');
$this->sql('ALTER TABLE blog_articles ALTER uuid SET NOT NULL');
$this->sql('CREATE UNIQUE INDEX UNIQ_CB80154FD17F50A6 ON blog_articles (uuid)');
}

if ($this->isAppMigrationNotInstalledRemoveIfExists('Version20211001064130')) {
$this->sql('ALTER TABLE blog_articles ALTER publish_date TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->sql('ALTER TABLE blog_articles ALTER publish_date DROP DEFAULT');
}

if ($this->isAppMigrationNotInstalledRemoveIfExists('Version20230331101850')) {
$this->sql('ALTER TABLE blog_articles ALTER publish_date TYPE DATE');
}

$this->sql('
UPDATE blog_article_translations
SET description = \'<div class="gjs-text-ckeditor">\' || description || \'</div>\'
WHERE description IS NOT NULL AND description NOT LIKE \'%gjs-text-ckeditor%\'
');
}

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function down(Schema $schema): void
{
}
}

0 comments on commit caac8e1

Please sign in to comment.