This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
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 #6 from kdambekalns/patch-1
TASK: Add PostgreSQL migration
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
namespace Neos\Flow\Persistence\Doctrine\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Initial DB structure | ||
*/ | ||
class Version20171015140356 extends AbstractMigration | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getDescription() | ||
{ | ||
return 'Initial DB structure'; | ||
} | ||
|
||
/** | ||
* @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 cm_neos_thememodule_domain_model_settings (persistence_object_identifier VARCHAR(40) NOT NULL, customscss TEXT DEFAULT \'\', customcss TEXT DEFAULT \'\', customsettings TEXT DEFAULT \'\', PRIMARY KEY(persistence_object_identifier))'); | ||
} | ||
|
||
/** | ||
* @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 cm_neos_thememodule_domain_model_settings'); | ||
} | ||
} |