Skip to content

Commit

Permalink
Fix doctrine migrations
Browse files Browse the repository at this point in the history
Context:

The commit 060d162 updated the composer
dependencies and introduced some breakages.

The composer.lock was using the doctrine/doctrine-migrations-bundle:v1.3.2
and the doctrine/migrations:v1.8.1 versions.

The doctrine/migrations package major upgrade to the v2.0.0 version changed
the autoload namespace of AbstractMigration class and started to use the new
PHP 7.0 return type declarations feature.

Fix #317
  • Loading branch information
lemuelroberto authored and Zales0123 committed Jan 22, 2019
1 parent 89bebc6 commit 5b5282c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Migrations/Version20170912085504.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace DoctrineMigrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
Expand All @@ -15,7 +15,7 @@ class Version20170912085504 extends AbstractMigration
/**
* @param Schema $schema
*/
public function up(Schema $schema)
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Expand Down Expand Up @@ -188,7 +188,7 @@ public function up(Schema $schema)
/**
* @param Schema $schema
*/
public function down(Schema $schema)
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Expand Down
6 changes: 3 additions & 3 deletions src/Migrations/Version20170913125128.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace DoctrineMigrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
Expand All @@ -15,7 +15,7 @@ class Version20170913125128 extends AbstractMigration
/**
* @param Schema $schema
*/
public function up(Schema $schema)
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Expand Down Expand Up @@ -47,7 +47,7 @@ public function up(Schema $schema)
/**
* @param Schema $schema
*/
public function down(Schema $schema)
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Expand Down
6 changes: 3 additions & 3 deletions src/Migrations/Version20171003103916.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace DoctrineMigrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Sylius\Component\Attribute\AttributeType\SelectAttributeType;
use Sylius\Component\Product\Model\ProductAttributeInterface;
Expand Down Expand Up @@ -32,7 +32,7 @@ public function setContainer(?ContainerInterface $container = null): void
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Expand Down Expand Up @@ -68,7 +68,7 @@ public function up(Schema $schema): void
/**
* @param Schema $schema
*/
public function down(Schema $schema): void
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Expand Down
6 changes: 3 additions & 3 deletions src/Migrations/Version20180102140039.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

namespace DoctrineMigrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180102140039 extends AbstractMigration
{
public function up(Schema $schema)
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE INDEX IDX_16C8119EE551C011 ON sylius_channel (hostname)');
}

public function down(Schema $schema)
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
Expand Down

0 comments on commit 5b5282c

Please sign in to comment.