forked from ttreeagency/ContentRepositoryImporter
-
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.
Merge pull request ttreeagency#21 from ttreeagency/task-postgresql
TASK: Add support for PostgreSQL
- Loading branch information
Showing
5 changed files
with
110 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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,42 @@ | ||
<?php | ||
namespace Neos\Flow\Persistence\Doctrine\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Adapt column naming to support PostgreSQL | ||
*/ | ||
class Version20170718190551 extends AbstractMigration | ||
{ | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDescription() | ||
{ | ||
return 'Adapt column naming to support PostgreSQL'; | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); | ||
|
||
$this->addSql('ALTER TABLE ttree_contentrepositoryimporter_domain_model_import CHANGE start starttime DATETIME NOT NULL, end endtime DATETIME DEFAULT NULL'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); | ||
|
||
$this->addSql('ALTER TABLE ttree_contentrepositoryimporter_domain_model_import CHANGE starttime start DATETIME NOT NULL, endtime end DATETIME DEFAULT NULL'); | ||
} | ||
} |
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,49 @@ | ||
<?php | ||
namespace Neos\Flow\Persistence\Doctrine\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Add tables to store content repository importer data | ||
*/ | ||
class Version20170718190551 extends AbstractMigration | ||
{ | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDescription() | ||
{ | ||
return 'Add tables to store content repository importer data'; | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); | ||
|
||
$this->addSql('CREATE TABLE ttree_contentrepositoryimporter_domain_model_import (persistence_object_identifier VARCHAR(40) NOT NULL, starttime TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, endtime TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, externalimportidentifier VARCHAR(255) DEFAULT NULL, PRIMARY KEY(persistence_object_identifier))'); | ||
$this->addSql('CREATE TABLE ttree_contentrepositoryimporter_domain_model_recordmapping (persistence_object_identifier VARCHAR(40) NOT NULL, creationdate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, modificationdate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, importerclassname VARCHAR(255) NOT NULL, importerclassnamehash VARCHAR(32) NOT NULL, externalidentifier VARCHAR(255) NOT NULL, externalrelativeuri VARCHAR(255) DEFAULT NULL, nodeidentifier VARCHAR(255) NOT NULL, nodepath VARCHAR(4000) NOT NULL, nodepathhash VARCHAR(32) NOT NULL, PRIMARY KEY(persistence_object_identifier))'); | ||
$this->addSql('CREATE INDEX nodepathhash ON ttree_contentrepositoryimporter_domain_model_recordmapping (nodepathhash)'); | ||
$this->addSql('CREATE INDEX nodeidentifier ON ttree_contentrepositoryimporter_domain_model_recordmapping (nodeidentifier)'); | ||
$this->addSql('CREATE UNIQUE INDEX UNIQ_8C1932AD8FC282F11EE98D63 ON ttree_contentrepositoryimporter_domain_model_recordmapping (importerclassnamehash, externalidentifier)'); | ||
$this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event ADD externalidentifier VARCHAR(255) DEFAULT NULL'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @return void | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); | ||
|
||
$this->addSql('DROP TABLE ttree_contentrepositoryimporter_domain_model_import'); | ||
$this->addSql('DROP TABLE ttree_contentrepositoryimporter_domain_model_recordmapping'); | ||
$this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event DROP externalidentifier'); | ||
} | ||
} |