當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Configuration::createMigrationTable方法代碼示例

本文整理匯總了PHP中Doctrine\DBAL\Migrations\Configuration\Configuration::createMigrationTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configuration::createMigrationTable方法的具體用法?PHP Configuration::createMigrationTable怎麽用?PHP Configuration::createMigrationTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\DBAL\Migrations\Configuration\Configuration的用法示例。


在下文中一共展示了Configuration::createMigrationTable方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: markVersion

 private function markVersion($direction)
 {
     if ($direction == 'up') {
         $action = 'insert';
     } else {
         $action = 'delete';
     }
     $this->configuration->createMigrationTable();
     $this->connection->{$action}($this->configuration->getMigrationsTableName(), [$this->configuration->getMigrationsColumnName() => $this->version]);
 }
開發者ID:DIPcom,項目名稱:Sandmin,代碼行數:10,代碼來源:Version.php

示例2: markNotMigrated

 public function markNotMigrated()
 {
     $this->configuration->createMigrationTable();
     $this->connection->delete($this->configuration->getMigrationsTableName(), array('version' => $this->version));
 }
開發者ID:berchapman,項目名稱:ice9,代碼行數:5,代碼來源:Version.php

示例3: markNotMigrated

 public function markNotMigrated()
 {
     $this->configuration->createMigrationTable();
     $this->connection->executeQuery("DELETE FROM " . $this->configuration->getMigrationsTableName() . " WHERE version = ?", array($this->version));
 }
開發者ID:saberyounis,項目名稱:Sonata-Project,代碼行數:5,代碼來源:Version.php

示例4: getMigrationConfiguration

 /**
  * Return the configuration needed for Migrations.
  *
  * @return Configuration
  */
 protected function getMigrationConfiguration()
 {
     $this->output = array();
     $that = $this;
     $outputWriter = new OutputWriter(function ($message) use($that) {
         $that->output[] = $message;
     });
     /** @var \Doctrine\DBAL\Connection $connection */
     $connection = $this->entityManager->getConnection();
     $schemaManager = $connection->getSchemaManager();
     if ($schemaManager->tablesExist(array('flow3_doctrine_migrationstatus')) === true) {
         $schemaManager->renameTable('flow3_doctrine_migrationstatus', self::DOCTRINE_MIGRATIONSTABLENAME);
     }
     $configuration = new Configuration($connection, $outputWriter);
     $configuration->setMigrationsNamespace('TYPO3\\Flow\\Persistence\\Doctrine\\Migrations');
     $configuration->setMigrationsDirectory(Files::concatenatePaths(array(FLOW_PATH_DATA, 'DoctrineMigrations')));
     $configuration->setMigrationsTableName(self::DOCTRINE_MIGRATIONSTABLENAME);
     $configuration->createMigrationTable();
     $databasePlatformName = $this->getDatabasePlatformName();
     /** @var PackageInterface $package */
     foreach ($this->packageManager->getActivePackages() as $package) {
         $path = Files::concatenatePaths(array($package->getPackagePath(), 'Migrations', $databasePlatformName));
         if (is_dir($path)) {
             $configuration->registerMigrationsFromDirectory($path);
         }
     }
     return $configuration;
 }
開發者ID:fcool,項目名稱:flow-development-collection,代碼行數:33,代碼來源:Service.php

示例5: markNotMigrated

 public function markNotMigrated()
 {
     $this->configuration->createMigrationTable();
     $this->connection->delete($this->configuration->getMigrationsTableName(), [$this->configuration->getMigrationsColumnName() => $this->version]);
 }
開發者ID:m00t,項目名稱:migrations,代碼行數:5,代碼來源:Version.php

示例6: getMigrationConfiguration

 /**
  * Return the configuration needed for Migrations.
  *
  * @return \Doctrine\DBAL\Migrations\Configuration\Configuration
  */
 protected function getMigrationConfiguration()
 {
     if ($this->migrationConfiguration === null) {
         $this->output = array();
         $that = $this;
         $outputWriter = new \Doctrine\DBAL\Migrations\OutputWriter(function ($message) use($that) {
             $that->output[] = $message;
         });
         $connection = $this->entityManager->getConnection();
         $migrationsDirectory = $this->getMigrationsDirectory();
         $configuration = new \Doctrine\DBAL\Migrations\Configuration\Configuration($connection, $outputWriter);
         $configuration->setMigrationsNamespace($this->getMigrationsNameSpace());
         $configuration->setMigrationsDirectory($migrationsDirectory);
         $configuration->setMigrationsTableName(Keys::MIGRATIONS_TABLENAME);
         $configuration->createMigrationTable();
         $configuration->registerMigrationsFromDirectory($migrationsDirectory);
         $this->migrationConfiguration = $configuration;
     }
     return $this->migrationConfiguration;
 }
開發者ID:dittertp,項目名稱:noa,代碼行數:25,代碼來源:MigrationService.php


注:本文中的Doctrine\DBAL\Migrations\Configuration\Configuration::createMigrationTable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。