Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Add a missing PostgreSQL migration
A schema migration allowing NULL values for image dimensions was missing for PostgreSQL.
- Loading branch information
1 parent
ca81a1d
commit cb89c7a
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
TYPO3.Media/Migrations/Postgresql/Version20150701113247.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
namespace TYPO3\Flow\Persistence\Doctrine\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration, | ||
Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Allow NULL values for image dimensions | ||
*/ | ||
class Version20150701113247 extends AbstractMigration { | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
*/ | ||
public function up(Schema $schema) { | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); | ||
|
||
$this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER width DROP NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER height DROP NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER width DROP NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER height DROP NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER width DROP NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER height DROP NOT NULL"); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
*/ | ||
public function down(Schema $schema) { | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); | ||
|
||
$this->addSql("CREATE SCHEMA public"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER width SET NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER height SET NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER width SET NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER height SET NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER width SET NOT NULL"); | ||
$this->addSql("ALTER TABLE typo3_media_domain_model_thumbnail ALTER height SET NOT NULL"); | ||
} | ||
} |