"Fossies" - the Fresh Open Source Software Archive

Member "neos-development-collection-7.0.1/Neos.Media/Migrations/Postgresql/Version20150305113900.php" (23 Feb 2021, 1393 Bytes) of package /linux/www/neos-development-collection-7.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Version20150305113900.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 namespace Neos\Flow\Persistence\Doctrine\Migrations;
    3 
    4 use Doctrine\Migrations\AbstractMigration;
    5 use Doctrine\DBAL\Schema\Schema;
    6 
    7 /**
    8  * Migration that adds position to ImageAdjustments.
    9  */
   10 class Version20150305113900 extends AbstractMigration
   11 {
   12     /**
   13      * @param Schema $schema
   14      * @return void
   15      */
   16     public function up(Schema $schema): void 
   17     {
   18         $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql");
   19 
   20         $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ADD position INT NULL");
   21         $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 10 WHERE dtype = 'typo3_media_adjustment_cropimageadjustment'");
   22         $this->addSql("UPDATE typo3_media_domain_model_adjustment_abstractimageadjustment SET position = 20 WHERE dtype = 'typo3_media_adjustment_resizeimageadjustment'");
   23         $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment ALTER position SET NOT NULL");
   24     }
   25 
   26     /**
   27      * @param Schema $schema
   28      * @return void
   29      */
   30     public function down(Schema $schema): void 
   31     {
   32         $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql");
   33 
   34         $this->addSql("ALTER TABLE typo3_media_domain_model_adjustment_abstractimageadjustment DROP position");
   35     }
   36 }