/**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
     // collect foreign keys pointing to "our" tables
     $tableNames = array('typo3_typo3cr_migration_domain_model_migrationstatus', 'typo3_typo3cr_domain_model_contentobjectproxy', 'typo3_typo3cr_domain_model_node', 'typo3_typo3cr_domain_model_workspace');
     $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, $tableNames, 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_contentobjectproxy DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_contentobjectproxy CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_contentobjectproxy ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_node DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_node CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_node ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_workspace DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_workspace CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_workspace ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_typo3cr_migration_domain_model_migrationstatus DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_typo3cr_migration_domain_model_migrationstatus CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_typo3cr_migration_domain_model_migrationstatus ADD PRIMARY KEY (flow3_persistence_identifier)");
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
 }
 /**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql");
     // collect foreign keys pointing to "our" tables
     $tableNames = array('typo3_flow_resource_publishing_abstractpublishingconfiguration', 'typo3_flow_resource_resource', 'typo3_flow_security_account', 'typo3_flow_security_authorization_resource_securitypublis_861cb');
     $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, $tableNames, 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     $this->addSql("ALTER TABLE typo3_flow_resource_publishing_abstractpublishingconfiguration RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     $this->addSql("ALTER TABLE typo3_flow_resource_resource RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     $this->addSql("ALTER TABLE typo3_flow_security_account RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     $this->addSql("ALTER TABLE typo3_flow_security_authorization_resource_securitypublis_861cb RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
     // rename tables
     $this->addSql("ALTER TABLE typo3_flow_mvc_routing_objectpathmapping RENAME TO typo3_flow3_mvc_routing_objectpathmapping");
     $this->addSql("ALTER TABLE typo3_flow_resource_publishing_abstractpublishingconfiguration RENAME TO typo3_flow3_resource_publishing_abstractpublishingconfiguration");
     $this->addSql("ALTER TABLE typo3_flow_resource_resource RENAME TO typo3_flow3_resource_resource");
     $this->addSql("ALTER TABLE typo3_flow_resource_resourcepointer RENAME TO typo3_flow3_resource_resourcepointer");
     $this->addSql("ALTER TABLE typo3_flow_security_account RENAME TO typo3_flow3_security_account");
     $this->addSql("ALTER TABLE typo3_flow_security_authorization_resource_securitypublis_861cb RENAME TO typo3_flow3_security_authorization_resource_securitypubli_6180a");
     $this->addSql("ALTER TABLE typo3_flow_security_policy_role RENAME TO typo3_flow3_security_policy_role");
 }
예제 #3
0
 /**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
     // collect foreign keys pointing to "our" tables
     $tableNames = array('typo3_party_domain_model_abstractparty', 'typo3_party_domain_model_electronicaddress', 'typo3_party_domain_model_person', 'typo3_party_domain_model_personname');
     $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, $tableNames, 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     $this->addSql("ALTER TABLE typo3_party_domain_model_abstractparty DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_party_domain_model_abstractparty CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_party_domain_model_abstractparty ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_party_domain_model_electronicaddress ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_party_domain_model_person DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_party_domain_model_person CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_party_domain_model_person ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_party_domain_model_personname DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_party_domain_model_personname CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_party_domain_model_personname ADD PRIMARY KEY (flow3_persistence_identifier)");
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
 }
 /**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql");
     // collect foreign keys pointing to "our" tables
     $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_media_domain_model_image'), 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     $this->addSql("ALTER TABLE typo3_media_domain_model_image RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
 }
 /**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
     // collect foreign keys pointing to "our" tables
     $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, array('typo3_phoenixdemotypo3org_domain_model_registration'), 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     $this->addSql("ALTER TABLE typo3_phoenixdemotypo3org_domain_model_registration DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_phoenixdemotypo3org_domain_model_registration CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_phoenixdemotypo3org_domain_model_registration ADD PRIMARY KEY (flow3_persistence_identifier)");
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
 }
 /**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql");
     // collect foreign keys pointing to "our" tables
     $tableNames = array('typo3_typo3cr_migration_domain_model_migrationstatus', 'typo3_typo3cr_domain_model_contentobjectproxy', 'typo3_typo3cr_domain_model_node', 'typo3_typo3cr_domain_model_workspace');
     $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, $tableNames, 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_contentobjectproxy RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_node RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     $this->addSql("ALTER TABLE typo3_typo3cr_domain_model_workspace RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     $this->addSql("ALTER TABLE typo3_typo3cr_migration_domain_model_migrationstatus RENAME COLUMN persistence_object_identifier TO flow3_persistence_identifier");
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
 }
예제 #7
0
 /**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
     // collect foreign keys pointing to "our" tables
     $foreignKeyHandlingSql = Service::getForeignKeyHandlingSql($schema, $this->platform, $this->tables, 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     foreach ($this->tables as $tableName) {
         $this->addSql('ALTER TABLE ' . $tableName . ' DROP PRIMARY KEY');
         $this->addSql('ALTER TABLE ' . $tableName . ' CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL');
         $this->addSql('ALTER TABLE ' . $tableName . ' ADD PRIMARY KEY (flow3_persistence_identifier)');
     }
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
 }
 /**
  * @param Schema $schema
  * @return void
  */
 public function down(Schema $schema)
 {
     $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
     // collect foreign keys pointing to "our" tables
     $tableNames = array('typo3_flow_resource_publishing_abstractpublishingconfiguration', 'typo3_flow_resource_resource', 'typo3_flow_security_account', 'typo3_flow_security_authorization_resource_securitypublis_861cb');
     $foreignKeyHandlingSql = \TYPO3\Flow\Persistence\Doctrine\Service::getForeignKeyHandlingSql($schema, $this->platform, $tableNames, 'persistence_object_identifier', 'flow3_persistence_identifier');
     // drop FK constraints
     foreach ($foreignKeyHandlingSql['drop'] as $sql) {
         $this->addSql($sql);
     }
     // rename identifier fields
     $this->addSql("ALTER TABLE typo3_flow_resource_publishing_abstractpublishingconfiguration DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_flow_resource_publishing_abstractpublishingconfiguration CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_flow_resource_publishing_abstractpublishingconfiguration ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_flow_resource_resource DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_flow_resource_resource CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_flow_resource_resource ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_flow_security_account DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_flow_security_account CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_flow_security_account ADD PRIMARY KEY (flow3_persistence_identifier)");
     $this->addSql("ALTER TABLE typo3_flow_security_authorization_resource_securitypublis_861cb DROP PRIMARY KEY");
     $this->addSql("ALTER TABLE typo3_flow_security_authorization_resource_securitypublis_861cb CHANGE persistence_object_identifier flow3_persistence_identifier VARCHAR(40) NOT NULL");
     $this->addSql("ALTER TABLE typo3_flow_security_authorization_resource_securitypublis_861cb ADD PRIMARY KEY (flow3_persistence_identifier)");
     // add back FK constraints
     foreach ($foreignKeyHandlingSql['add'] as $sql) {
         $this->addSql($sql);
     }
     // rename tables
     $this->addSql("RENAME TABLE typo3_flow_mvc_routing_objectpathmapping TO typo3_flow3_mvc_routing_objectpathmapping");
     $this->addSql("RENAME TABLE typo3_flow_resource_publishing_abstractpublishingconfiguration TO typo3_flow3_resource_publishing_abstractpublishingconfiguration");
     $this->addSql("RENAME TABLE typo3_flow_resource_resource TO typo3_flow3_resource_resource");
     $this->addSql("RENAME TABLE typo3_flow_resource_resourcepointer TO typo3_flow3_resource_resourcepointer");
     $this->addSql("RENAME TABLE typo3_flow_security_account TO typo3_flow3_security_account");
     $this->addSql("RENAME TABLE typo3_flow_security_authorization_resource_securitypublis_861cb TO typo3_flow3_security_authorization_resource_securitypubli_6180a");
     $this->addSql("RENAME TABLE typo3_flow_security_policy_role TO typo3_flow3_security_policy_role");
 }