From d307034da96ccfef536bca0dae84598850375e69 Mon Sep 17 00:00:00 2001 From: Saidi Date: Mon, 13 May 2024 15:50:03 +0200 Subject: [PATCH] check if column exists #2482 --- ...{Version20240426100957.php => Version20240513134105.php} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename migrations/{Version20240426100957.php => Version20240513134105.php} (66%) diff --git a/migrations/Version20240426100957.php b/migrations/Version20240513134105.php similarity index 66% rename from migrations/Version20240426100957.php rename to migrations/Version20240513134105.php index 5a8f6255a..b383a1f1f 100644 --- a/migrations/Version20240426100957.php +++ b/migrations/Version20240513134105.php @@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; -final class Version20240426100957 extends AbstractMigration +final class Version20240513134105 extends AbstractMigration { public function getDescription(): string { @@ -16,7 +16,9 @@ public function getDescription(): string public function up(Schema $schema): void { - $this->addSql('ALTER TABLE file ADD is_temp TINYINT(1) NOT NULL'); + if (!$schema->getTable('file')->hasColumn('is_temp')) { + $this->addSql('ALTER TABLE file ADD is_temp TINYINT(1) NOT NULL'); + } } public function down(Schema $schema): void