Skip to content

Commit

Permalink
TASK: Apply migration Neos.Flow-20201109224100
Browse files Browse the repository at this point in the history
Adjust DB migrations to Doctrine Migrations 3.0

See neos/flow-development-collection#1880
See neos/flow-development-collection#2122
  • Loading branch information
kdambekalns committed Nov 13, 2020
1 parent b798d56 commit f512799
Show file tree
Hide file tree
Showing 29 changed files with 88 additions and 87 deletions.
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20110613224537.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20110613224537 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("CREATE TABLE party_abstractparty (flow3_persistence_identifier VARCHAR(40) NOT NULL, dtype VARCHAR(255) NOT NULL, PRIMARY KEY(flow3_persistence_identifier)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB");
Expand All @@ -37,7 +37,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

if ($this->sm->tablesExist(array('flow3_security_account'))) {
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20110714212900.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20110714212900 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("UPDATE party_abstractparty SET dtype=CONCAT('typo3_', SUBSTR(dtype, 4)) WHERE dtype LIKE 'f3_%'");
Expand All @@ -23,7 +23,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("UPDATE party_abstractparty SET dtype=CONCAT('f3_', SUBSTR(dtype, 4)) WHERE dtype LIKE 'typo3_%'");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20110824124935.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20110824124935 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("RENAME TABLE party_abstractparty TO typo3_party_domain_model_abstractparty");
Expand All @@ -27,7 +27,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("RENAME TABLE typo3_party_domain_model_abstractparty TO party_abstractparty");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20110923125536.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20110923125536 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_person DROP FOREIGN KEY typo3_party_domain_model_person_ibfk_1");
Expand All @@ -31,7 +31,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_person DROP FOREIGN KEY typo3_party_domain_model_person_ibfk_1");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20120329220341.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20120329220341 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress CHANGE identifier identifier VARCHAR(255) NOT NULL, CHANGE approved approved TINYINT(1) NOT NULL");
Expand All @@ -24,7 +24,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress CHANGE identifier identifier VARCHAR(255) DEFAULT NULL, CHANGE approved approved TINYINT(1) DEFAULT NULL");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20120429213446.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20120429213446 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("CREATE UNIQUE INDEX flow3_identity_typo3_party_domain_model_electronicaddress ON typo3_party_domain_model_electronicaddress (identifier, type, usagetype)");
Expand All @@ -23,7 +23,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("DROP INDEX flow3_identity_typo3_party_domain_model_electronicaddress ON typo3_party_domain_model_electronicaddress");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20120521125401.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20120521125401 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("DROP INDEX flow3_identity_typo3_party_domain_model_electronicaddress ON typo3_party_domain_model_electronicaddress");
Expand All @@ -23,7 +23,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("CREATE UNIQUE INDEX flow3_identity_typo3_party_domain_model_electronicaddress ON typo3_party_domain_model_electronicaddress (identifier, type, usagetype)");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20120525141545.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20120525141545 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress CHANGE usagetype usagetype VARCHAR(20) DEFAULT NULL");
Expand All @@ -23,7 +23,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress CHANGE usagetype usagetype VARCHAR(20) NOT NULL");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20120930211542.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
use Doctrine\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema,
Neos\Flow\Persistence\Doctrine\Service;

Expand All @@ -14,7 +14,7 @@ class Version20120930211542 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

// collect foreign keys pointing to "our" tables
Expand Down Expand Up @@ -55,7 +55,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

// collect foreign keys pointing to "our" tables
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20150206113911.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

Expand All @@ -15,7 +15,7 @@ class Version20150206113911 extends AbstractMigration {
* @return void
* @throws MigrationException
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("CREATE TABLE typo3_party_domain_model_abstractparty_accounts_join (party_abstractparty VARCHAR(40) NOT NULL, flow_security_account VARCHAR(40) NOT NULL, INDEX IDX_1EEEBC2F38110E12 (party_abstractparty), UNIQUE INDEX UNIQ_1EEEBC2F58842EFC (flow_security_account), PRIMARY KEY(party_abstractparty, flow_security_account)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB");
Expand All @@ -32,7 +32,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

if ($this->partyColumnInFlowSecurityAccountExists()) {
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20150217145853.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20150217145853 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

if ($this->sm->tablesExist(['typo3_flow_security_account'])) {
Expand All @@ -29,7 +29,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_abstractparty_accounts_join DROP FOREIGN KEY FK_1EEEBC2F58842EFC");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20150309181636.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20150309181636 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_person_electronicaddresses_join DROP FOREIGN KEY typo3_party_domain_model_person_electronicaddresses_join_ibfk_2");
Expand All @@ -33,7 +33,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_person_electronicaddresses_join DROP FOREIGN KEY typo3_party_domain_model_person_electronicaddresses_join_ibfk_2");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20150612093351.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -14,7 +14,7 @@ class Version20150612093351 extends AbstractMigration {
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
public function up(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress ADD dtype VARCHAR(255) NOT NULL");
Expand All @@ -27,7 +27,7 @@ public function up(Schema $schema) {
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
public function down(Schema $schema): void {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

$this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress DROP dtype");
Expand Down
6 changes: 3 additions & 3 deletions Migrations/Mysql/Version20161124230946.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Neos\Flow\Persistence\Doctrine\Migrations;

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

/**
Expand All @@ -13,7 +13,7 @@ class Version20161124230946 extends AbstractMigration
* @param Schema $schema
* @return void
*/
public function up(Schema $schema)
public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

Expand All @@ -29,7 +29,7 @@ public function up(Schema $schema)
* @param Schema $schema
* @return void
*/
public function down(Schema $schema)
public function down(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

Expand Down
Loading

0 comments on commit f512799

Please sign in to comment.