Skip to content

Instantly share code, notes, and snippets.

@albe
Created April 7, 2015 13:09
Show Gist options
  • Save albe/cb9c19e891c1ef8fca92 to your computer and use it in GitHub Desktop.
Save albe/cb9c19e891c1ef8fca92 to your computer and use it in GitHub Desktop.
<?php
namespace TYPO3\Flow\Persistence\Doctrine\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your need!
*/
class Version20150407145620 extends AbstractMigration {
/**
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("ALTER TABLE acme_test_domain_model_subject DROP FOREIGN KEY FK_C87B915E60577090");
$this->addSql("DROP INDEX UNIQ_C87B915E60577090 ON acme_test_domain_model_subject");
$this->addSql("ALTER TABLE acme_test_domain_model_subject DROP related");
}
/**
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("ALTER TABLE acme_test_domain_model_subject ADD related VARCHAR(40) DEFAULT NULL COLLATE utf8_unicode_ci");
$this->addSql("ALTER TABLE acme_test_domain_model_subject ADD CONSTRAINT FK_C87B915E60577090 FOREIGN KEY (related) REFERENCES acme_test_domain_model_related (persistence_object_identifier)");
$this->addSql("CREATE UNIQUE INDEX UNIQ_C87B915E60577090 ON acme_test_domain_model_subject (related)");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment