From 258a75478890644dbfaac14af5b6c6faa7ee2b95 Mon Sep 17 00:00:00 2001 From: Robin Krahnen Date: Wed, 8 Sep 2021 16:42:05 +0200 Subject: [PATCH] update migrations --- Migrations/Mysql/Version20140505093853.php | 32 ++++++++-------------- Migrations/Mysql/Version20160624203903.php | 32 ++++++++-------------- 2 files changed, 22 insertions(+), 42 deletions(-) diff --git a/Migrations/Mysql/Version20140505093853.php b/Migrations/Mysql/Version20140505093853.php index 05b424e..d1aa1a3 100644 --- a/Migrations/Mysql/Version20140505093853.php +++ b/Migrations/Mysql/Version20140505093853.php @@ -2,43 +2,33 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\DBAL\Exception as DoctrineDBALException; +use Doctrine\DBAL\Migrations\AbortMigrationException; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; -/** - * Auto-generated Migration: Please modify to your needs! This block will be used as the migration description if getDescription() is not used. - */ class Version20140505093853 extends AbstractMigration { - - /** - * @return string - */ - public function getDescription() - { - return ''; - } - /** * @param Schema $schema - * @return void + * @throws AbortMigrationException + * @throws DoctrineDBALException */ - public function up(Schema $schema) + public function up(Schema $schema): void { - // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE TABLE digicomp_sequence_domain_model_insert (number INT NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(number, type))'); } /** * @param Schema $schema - * @return void + * @throws AbortMigrationException + * @throws DoctrineDBALException */ - public function down(Schema $schema) + public function down(Schema $schema): void { - // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP TABLE digicomp_sequence_domain_model_insert'); } diff --git a/Migrations/Mysql/Version20160624203903.php b/Migrations/Mysql/Version20160624203903.php index 0d9ad16..96dcabd 100644 --- a/Migrations/Mysql/Version20160624203903.php +++ b/Migrations/Mysql/Version20160624203903.php @@ -2,43 +2,33 @@ namespace Neos\Flow\Persistence\Doctrine\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\DBAL\Exception as DoctrineDBALException; +use Doctrine\DBAL\Migrations\AbortMigrationException; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; -/** - * Auto-generated Migration: Please modify to your needs! This block will be used as the migration description if getDescription() is not used. - */ class Version20160624203903 extends AbstractMigration { - - /** - * @return string - */ - public function getDescription() - { - return ''; - } - /** * @param Schema $schema - * @return void + * @throws AbortMigrationException + * @throws DoctrineDBALException */ - public function up(Schema $schema) + public function up(Schema $schema): void { - // this up() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); $this->addSql('CREATE INDEX type_idx ON digicomp_sequence_domain_model_insert (type)'); } /** * @param Schema $schema - * @return void + * @throws AbortMigrationException + * @throws DoctrineDBALException */ - public function down(Schema $schema) + public function down(Schema $schema): void { - // this down() migration is autogenerated, please modify it to your needs - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".'); $this->addSql('DROP INDEX type_idx ON digicomp_sequence_domain_model_insert'); }