Skip to content

Commit 60bf5d6

Browse files
committed
TASK: Apply migration Neos.Flow-20201109224100
Adjust DB migrations to Doctrine Migrations 3.0
1 parent ed3a663 commit 60bf5d6

9 files changed

+31
-30
lines changed

Migrations/Mysql/Version20171120150210.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace Neos\Flow\Persistence\Doctrine\Migrations;
33

4-
use Doctrine\DBAL\Migrations\AbstractMigration;
4+
use Doctrine\Migrations\AbstractMigration;
55
use Doctrine\DBAL\Schema\Schema;
66

77
class Version20171120150210 extends AbstractMigration
@@ -10,7 +10,7 @@ class Version20171120150210 extends AbstractMigration
1010
/**
1111
* @return string
1212
*/
13-
public function getDescription()
13+
public function getDescription(): string
1414
{
1515
return 'Introduce OAuth Token';
1616
}
@@ -19,7 +19,7 @@ public function getDescription()
1919
* @param Schema $schema
2020
* @return void
2121
*/
22-
public function up(Schema $schema)
22+
public function up(Schema $schema): void
2323
{
2424
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
2525
$this->addSql('CREATE TABLE flownative_oauth2_client_oauthtoken (clientid VARCHAR(255) NOT NULL, servicename VARCHAR(255) NOT NULL, clientsecret VARCHAR(255) NOT NULL, accesstoken VARCHAR(255) NOT NULL, refreshtoken VARCHAR(255) NOT NULL, expires DATETIME DEFAULT NULL, PRIMARY KEY(clientid, servicename)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
@@ -29,7 +29,7 @@ public function up(Schema $schema)
2929
* @param Schema $schema
3030
* @return void
3131
*/
32-
public function down(Schema $schema)
32+
public function down(Schema $schema): void
3333
{
3434
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3535
$this->addSql('DROP TABLE flownative_oauth2_client_oauthtoken');

Migrations/Mysql/Version20171121093644.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace Neos\Flow\Persistence\Doctrine\Migrations;
33

4-
use Doctrine\DBAL\Migrations\AbstractMigration;
4+
use Doctrine\Migrations\AbstractMigration;
55
use Doctrine\DBAL\Schema\Schema;
66

77
/**
@@ -13,7 +13,7 @@ class Version20171121093644 extends AbstractMigration
1313
/**
1414
* @return string
1515
*/
16-
public function getDescription()
16+
public function getDescription(): string
1717
{
1818
return 'Introduce scope for OAuthToken';
1919
}
@@ -22,7 +22,7 @@ public function getDescription()
2222
* @param Schema $schema
2323
* @return void
2424
*/
25-
public function up(Schema $schema)
25+
public function up(Schema $schema): void
2626
{
2727
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
2828
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken ADD scope VARCHAR(255) NOT NULL');
@@ -32,7 +32,7 @@ public function up(Schema $schema)
3232
* @param Schema $schema
3333
* @return void
3434
*/
35-
public function down(Schema $schema)
35+
public function down(Schema $schema): void
3636
{
3737
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3838
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken DROP scope');

Migrations/Mysql/Version20171121130544.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace Neos\Flow\Persistence\Doctrine\Migrations;
33

4-
use Doctrine\DBAL\Migrations\AbstractMigration;
4+
use Doctrine\Migrations\AbstractMigration;
55
use Doctrine\DBAL\Schema\Schema;
66

77
/**
@@ -13,7 +13,7 @@ class Version20171121130544 extends AbstractMigration
1313
/**
1414
* @return string
1515
*/
16-
public function getDescription()
16+
public function getDescription(): string
1717
{
1818
return 'Introduce grant type';
1919
}
@@ -22,7 +22,7 @@ public function getDescription()
2222
* @param Schema $schema
2323
* @return void
2424
*/
25-
public function up(Schema $schema)
25+
public function up(Schema $schema): void
2626
{
2727
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
2828
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken ADD granttype VARCHAR(255) NOT NULL');
@@ -32,7 +32,7 @@ public function up(Schema $schema)
3232
* @param Schema $schema
3333
* @return void
3434
*/
35-
public function down(Schema $schema)
35+
public function down(Schema $schema): void
3636
{
3737
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3838
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken DROP granttype');

Migrations/Mysql/Version20171121134206.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace Neos\Flow\Persistence\Doctrine\Migrations;
33

4-
use Doctrine\DBAL\Migrations\AbstractMigration;
4+
use Doctrine\Migrations\AbstractMigration;
55
use Doctrine\DBAL\Schema\Schema;
66

77
/**
@@ -13,7 +13,7 @@ class Version20171121134206 extends AbstractMigration
1313
/**
1414
* @return string
1515
*/
16-
public function getDescription()
16+
public function getDescription(): string
1717
{
1818
return 'Make refresh token optional';
1919
}
@@ -22,7 +22,7 @@ public function getDescription()
2222
* @param Schema $schema
2323
* @return void
2424
*/
25-
public function up(Schema $schema)
25+
public function up(Schema $schema): void
2626
{
2727
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
2828
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken CHANGE refreshtoken refreshtoken VARCHAR(255) DEFAULT NULL');
@@ -32,7 +32,7 @@ public function up(Schema $schema)
3232
* @param Schema $schema
3333
* @return void
3434
*/
35-
public function down(Schema $schema)
35+
public function down(Schema $schema): void
3636
{
3737
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3838
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken CHANGE refreshtoken refreshtoken VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');

Migrations/Mysql/Version20171121134844.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace Neos\Flow\Persistence\Doctrine\Migrations;
33

4-
use Doctrine\DBAL\Migrations\AbstractMigration;
4+
use Doctrine\Migrations\AbstractMigration;
55
use Doctrine\DBAL\Schema\Schema;
66

77
/**
@@ -13,7 +13,7 @@ class Version20171121134844 extends AbstractMigration
1313
/**
1414
* @return string
1515
*/
16-
public function getDescription()
16+
public function getDescription(): string
1717
{
1818
return 'Longer fields for tokens and secret';
1919
}
@@ -22,7 +22,7 @@ public function getDescription()
2222
* @param Schema $schema
2323
* @return void
2424
*/
25-
public function up(Schema $schema)
25+
public function up(Schema $schema): void
2626
{
2727
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
2828
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken CHANGE clientsecret clientsecret VARCHAR(5000) DEFAULT NULL, CHANGE accesstoken accesstoken VARCHAR(5000) NOT NULL, CHANGE refreshtoken refreshtoken VARCHAR(5000) DEFAULT NULL');
@@ -32,7 +32,7 @@ public function up(Schema $schema)
3232
* @param Schema $schema
3333
* @return void
3434
*/
35-
public function down(Schema $schema)
35+
public function down(Schema $schema): void
3636
{
3737
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3838
$this->addSql('ALTER TABLE flownative_oauth2_client_oauthtoken CHANGE clientsecret clientsecret VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE accesstoken accesstoken VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE refreshtoken refreshtoken VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci');

Migrations/Mysql/Version20190528081304.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Version20190528081304 extends AbstractMigration
1313
/**
1414
* @return string
1515
*/
16-
public function getDescription()
16+
public function getDescription(): string
1717
{
1818
return 'Introduce "tokenValues" field';
1919
}
@@ -24,7 +24,7 @@ public function getDescription()
2424
* @throws \Doctrine\DBAL\DBALException
2525
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException
2626
*/
27-
public function up(Schema $schema)
27+
public function up(Schema $schema): void
2828
{
2929
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3030

@@ -37,7 +37,7 @@ public function up(Schema $schema)
3737
* @throws \Doctrine\DBAL\DBALException
3838
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException
3939
*/
40-
public function down(Schema $schema)
40+
public function down(Schema $schema): void
4141
{
4242
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
4343

Migrations/Mysql/Version20190610144513.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Version20190610144513 extends AbstractMigration
1313
/**
1414
* @return string
1515
*/
16-
public function getDescription()
16+
public function getDescription(): string
1717
{
1818
return 'Migrate to completely new model';
1919
}
@@ -24,7 +24,7 @@ public function getDescription()
2424
* @throws \Doctrine\DBAL\DBALException
2525
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException
2626
*/
27-
public function up(Schema $schema)
27+
public function up(Schema $schema): void
2828
{
2929
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3030

@@ -38,7 +38,7 @@ public function up(Schema $schema)
3838
* @throws \Doctrine\DBAL\DBALException
3939
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException
4040
*/
41-
public function down(Schema $schema)
41+
public function down(Schema $schema): void
4242
{
4343
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
4444

Migrations/Mysql/Version20190902073659.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Version20190902073659 extends AbstractMigration
1313
/**
1414
* @return string
1515
*/
16-
public function getDescription()
16+
public function getDescription(): string
1717
{
1818
return 'Authorizations v2';
1919
}
@@ -22,7 +22,7 @@ public function getDescription()
2222
* @param Schema $schema
2323
* @return void
2424
*/
25-
public function up(Schema $schema)
25+
public function up(Schema $schema): void
2626
{
2727
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
2828

@@ -33,7 +33,7 @@ public function up(Schema $schema)
3333
* @param Schema $schema
3434
* @return void
3535
*/
36-
public function down(Schema $schema)
36+
public function down(Schema $schema): void
3737
{
3838
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
3939

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"Neos.NodeTypes-20190917101945",
4444
"Neos.NodeTypes-20200120114136",
4545
"Neos.Flow-20200813181400",
46-
"Neos.Flow-20201003165200"
46+
"Neos.Flow-20201003165200",
47+
"Neos.Flow-20201109224100"
4748
]
4849
}
4950
}

0 commit comments

Comments
 (0)