forked from neos/neos-development-collection
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: Add forgotten migration on movedto
Change index on "movedto" to unique (was forgotten) See neos#2475
- Loading branch information
1 parent
273cf18
commit 5dbeca1
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
Neos.ContentRepository/Migrations/Mysql/Version20190503102824.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
namespace Neos\Flow\Persistence\Doctrine\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Change index on "movedto" to unique (was forgotten) | ||
*/ | ||
class Version20190503102824 extends AbstractMigration | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getDescription() | ||
{ | ||
return 'Change index on "movedto" to unique (was forgotten)'; | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); | ||
|
||
$this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); | ||
|
||
$this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX UNIQ_CE6515692D45FE4D, ADD INDEX IDX_CE6515692D45FE4D (movedto)'); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Neos.ContentRepository/Migrations/Postgresql/Version20190503102825.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
namespace Neos\Flow\Persistence\Doctrine\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Change index on "movedto" to unique (was forgotten) | ||
*/ | ||
class Version20190503102825 extends AbstractMigration | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getDescription() | ||
{ | ||
return 'Change index on "movedto" to unique (was forgotten)'; | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); | ||
|
||
$this->addSql('DROP INDEX idx_ce6515692d45fe4d'); | ||
$this->addSql('CREATE UNIQUE INDEX UNIQ_CE6515692D45FE4D ON neos_contentrepository_domain_model_nodedata (movedto)'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
* @throws \Doctrine\DBAL\Migrations\AbortMigrationException | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); | ||
|
||
$this->addSql('DROP INDEX UNIQ_CE6515692D45FE4D'); | ||
$this->addSql('CREATE INDEX idx_ce6515692d45fe4d ON neos_contentrepository_domain_model_nodedata (movedto)'); | ||
} | ||
} |