<commit_before><?php

declare(strict_types=1);

namespace Fusio\Impl\Migrations\Version;

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

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

    public function up(Schema $schema) : void
    {
    }

    public function down(Schema $schema) : void
    {
    }

    public function postUp(Schema $schema): void
    {
        $routes = [
            '/backend/routes/provider' => '/backend/generator',
            '/backend/routes/provider/:provider' => '/backend/generator/:provider',
        ];

        foreach ($routes as $oldPath => $newPath) {
            $this->connection->executeStatement('UPDATE fusio_routes SET path = :new_path WHERE path = :old_path', [
                'new_path' => $newPath,
                'old_path' => $oldPath,
            ]);
        }
    }
}<commit_msg>update migration<commit_after><?php

declare(strict_types=1);

namespace Fusio\Impl\Migrations\Version;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Fusio\Impl\Migrations\DataSyncronizer;
use Fusio\Impl\Table;

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

    public function up(Schema $schema) : void
    {
    }

    public function down(Schema $schema) : void
    {
    }

    public function postUp(Schema $schema): void
    {
        $routes = [
            '/backend/routes/provider',
            '/backend/routes/provider/:provider',
        ];

        foreach ($routes as $path) {
            $routeId = $this->connection->fetchOne('SELECT id FROM fusio_routes WHERE path = :path', ['path' => $path]);
            if (empty($routeId)) {
                continue;
            }

            $this->connection->update('fusio_routes', ['status' => Table\Route::STATUS_DELETED], ['id' => $routeId]);
        }

        DataSyncronizer::sync($this->connection);
    }
}
{'fraction_non_alphanumeric': 0.12910583941605838, 'fraction_numerical': 0.013686131386861315, 'mean_word_length': 2.5370967741935484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5210018', 'n_tokens_mistral': 658, 'n_tokens_neox': 641, 'n_words': 133}