From 9c565cbaedc41c28fadb406064e3e7c67ffdfa64 Mon Sep 17 00:00:00 2001 From: Marcel Diegelmann Date: Tue, 17 Jun 2025 13:54:50 +0200 Subject: [PATCH] SQL-Formatierung in Migration verbessern --- migrations/Version20250325073036.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/migrations/Version20250325073036.php b/migrations/Version20250325073036.php index dae163dc..a9d3eaaa 100644 --- a/migrations/Version20250325073036.php +++ b/migrations/Version20250325073036.php @@ -16,14 +16,22 @@ final class Version20250325073036 extends AbstractMultiPlatformMigration public function mySQLUp(Schema $schema): void { - $this->addSql('ALTER TABLE categories ADD COLUMN part_ipn_prefix VARCHAR(255) NOT NULL DEFAULT \'\''); - $this->addSql('DROP INDEX UNIQ_6940A7FE3D721C14 ON parts'); + $this->addSql(<<<'SQL' + ALTER TABLE categories ADD COLUMN part_ipn_prefix VARCHAR(255) NOT NULL DEFAULT '' + SQL); + $this->addSql(<<<'SQL' + DROP INDEX UNIQ_6940A7FE3D721C14 ON parts + SQL); } public function mySQLDown(Schema $schema): void { - $this->addSql('ALTER TABLE `categories` DROP part_ipn_prefix'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FE3D721C14 ON `parts` (ipn)'); + $this->addSql(<<<'SQL' + ALTER TABLE categories DROP part_ipn_prefixSQL + SQL); + $this->addSql(<<<'SQL' + CREATE UNIQUE INDEX UNIQ_6940A7FE3D721C14 ON parts (ipn) + SQL); } public function sqLiteUp(Schema $schema): void