Skip to content

Commit 594a577

Browse files
committed
Specify that we mean a column in drop statement. This is more correct
This should help with more strict sql servers like in issue #900
1 parent c0ef64f commit 594a577

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

migrations/Version20250220215048.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function up(Schema $schema): void
2222

2323
//Copy the data from path to external_path and remove the path column
2424
$this->addSql('UPDATE attachments SET external_path=path');
25-
$this->addSql('ALTER TABLE attachments DROP path');
25+
$this->addSql('ALTER TABLE attachments DROP COLUMN path');
2626

2727

2828
$this->addSql('UPDATE attachments SET internal_path=external_path WHERE external_path LIKE \'#%MEDIA#%%\' ESCAPE \'#\'');
@@ -36,7 +36,7 @@ public function up(Schema $schema): void
3636
public function down(Schema $schema): void
3737
{
3838
$this->addSql('UPDATE attachments SET external_path=internal_path WHERE internal_path IS NOT NULL');
39-
$this->addSql('ALTER TABLE attachments DROP internal_path');
39+
$this->addSql('ALTER TABLE attachments DROP COLUMN internal_path');
4040
$this->addSql('ALTER TABLE attachments RENAME COLUMN external_path TO path');
4141
}
4242
}

0 commit comments

Comments
 (0)