当前位置: 首页>>代码示例>>PHP>>正文


PHP Configuration::getMigrationsColumnName方法代码示例

本文整理汇总了PHP中Doctrine\DBAL\Migrations\Configuration\Configuration::getMigrationsColumnName方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::getMigrationsColumnName方法的具体用法?PHP Configuration::getMigrationsColumnName怎么用?PHP Configuration::getMigrationsColumnName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\DBAL\Migrations\Configuration\Configuration的用法示例。


在下文中一共展示了Configuration::getMigrationsColumnName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMigrationsInfos

 public function getMigrationsInfos()
 {
     $numExecutedUnavailableMigrations = count($this->executedUnavailableMigrations);
     $numNewMigrations = count(array_diff($this->availableMigrations, $this->executedMigrations));
     $infos = ['Name' => $this->configuration->getName() ? $this->configuration->getName() : 'Doctrine Database Migrations', 'Database Driver' => $this->configuration->getConnection()->getDriver()->getName(), 'Database Name' => $this->configuration->getConnection()->getDatabase(), 'Configuration Source' => $this->configuration instanceof AbstractFileConfiguration ? $this->configuration->getFile() : 'manually configured', 'Version Table Name' => $this->configuration->getMigrationsTableName(), 'Version Column Name' => $this->configuration->getMigrationsColumnName(), 'Migrations Namespace' => $this->configuration->getMigrationsNamespace(), 'Migrations Directory' => $this->configuration->getMigrationsDirectory(), 'Previous Version' => $this->getFormattedVersionAlias('prev'), 'Current Version' => $this->getFormattedVersionAlias('current'), 'Next Version' => $this->getFormattedVersionAlias('next'), 'Latest Version' => $this->getFormattedVersionAlias('latest'), 'Executed Migrations' => count($this->executedMigrations), 'Executed Unavailable Migrations' => $numExecutedUnavailableMigrations, 'Available Migrations' => count($this->availableMigrations), 'New Migrations' => $numNewMigrations];
     return $infos;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:7,代码来源:MigrationStatusInfosHelper.php

示例2: writeSqlFile

 /**
  * Write a migration SQL file to the given path
  *
  * @param string $path      The path to write the migration SQL file.
  * @param string $direction The direction to execute.
  *
  * @return boolean $written
  */
 public function writeSqlFile($path, $direction = self::DIRECTION_UP)
 {
     $queries = $this->execute($direction, true);
     $this->outputWriter->write("\n# Version " . $this->version . "\n");
     $sqlQueries = [$this->version => $queries];
     $sqlWriter = new SqlFileWriter($this->configuration->getMigrationsColumnName(), $this->configuration->getMigrationsTableName(), $path, $this->outputWriter);
     return $sqlWriter->write($sqlQueries, $direction);
 }
开发者ID:sly-pims,项目名称:skycellar,代码行数:16,代码来源:Version.php

示例3: writeSqlFile

 /**
  * Write a migration SQL file to the given path
  *
  * @param string $path      The path to write the migration SQL file.
  * @param string $direction The direction to execute.
  *
  * @return boolean $written
  */
 public function writeSqlFile($path, $direction = self::DIRECTION_UP)
 {
     $queries = $this->execute($direction, true);
     if (!empty($this->params)) {
         throw MigrationException::migrationNotConvertibleToSql($this->class);
     }
     $this->outputWriter->write("\n-- Version " . $this->version . "\n");
     $sqlQueries = [$this->version => $queries];
     $sqlWriter = new SqlFileWriter($this->configuration->getMigrationsColumnName(), $this->configuration->getMigrationsTableName(), $path, $this->outputWriter);
     return $sqlWriter->write($sqlQueries, $direction);
 }
开发者ID:doctrine,项目名称:migrations,代码行数:19,代码来源:Version.php

示例4: writeSqlFile

 /**
  * Write a migration SQL file to the given path
  *
  * @param string $path The path to write the migration SQL file.
  * @param string $to   The version to migrate to.
  *
  * @return boolean $written
  */
 public function writeSqlFile($path, $to = null)
 {
     $sql = $this->getSql($to);
     $from = $this->configuration->getCurrentVersion();
     if ($to === null) {
         $to = $this->configuration->getLatestVersion();
     }
     $direction = $from > $to ? Version::DIRECTION_DOWN : Version::DIRECTION_UP;
     $this->outputWriter->write(sprintf("# Migrating from %s to %s\n", $from, $to));
     $sqlWriter = new SqlFileWriter($this->configuration->getMigrationsColumnName(), $this->configuration->getMigrationsTableName(), $path, $this->outputWriter);
     return $sqlWriter->write($sql, $direction);
 }
开发者ID:fengxw,项目名称:dirty,代码行数:20,代码来源:Migration.php

示例5: getMigrationsInfos

 public function getMigrationsInfos()
 {
     $formattedVersions = [];
     foreach (['prev', 'current', 'next', 'latest'] as $alias) {
         $version = $this->configuration->resolveVersionAlias($alias);
         if ($version === null) {
             if ($alias == 'next') {
                 $formattedVersions[$alias] = 'Already at latest version';
             } elseif ($alias == 'prev') {
                 $formattedVersions[$alias] = 'Already at first version';
             }
         } elseif ($version === '0') {
             $formattedVersions[$alias] = '<comment>0</comment>';
         } else {
             $formattedVersions[$alias] = $this->configuration->getDateTime($version) . ' (<comment>' . $version . '</comment>)';
         }
     }
     $numExecutedUnavailableMigrations = count($this->executedUnavailableMigrations);
     $numNewMigrations = count(array_diff($this->availableMigrations, $this->executedMigrations));
     $infos = ['Name' => $this->configuration->getName() ? $this->configuration->getName() : 'Doctrine Database Migrations', 'Database Driver' => $this->configuration->getConnection()->getDriver()->getName(), 'Database Name' => $this->configuration->getConnection()->getDatabase(), 'Configuration Source' => $this->configuration instanceof AbstractFileConfiguration ? $this->configuration->getFile() : 'manually configured', 'Version Table Name' => $this->configuration->getMigrationsTableName(), 'Version Column Name' => $this->configuration->getMigrationsColumnName(), 'Migrations Namespace' => $this->configuration->getMigrationsNamespace(), 'Migrations Directory' => $this->configuration->getMigrationsDirectory(), 'Previous Version' => $formattedVersions['prev'], 'Current Version' => $formattedVersions['current'], 'Next Version' => $formattedVersions['next'], 'Latest Version' => $formattedVersions['latest'], 'Executed Migrations' => count($this->executedMigrations), 'Executed Unavailable Migrations' => $numExecutedUnavailableMigrations, 'Available Migrations' => count($this->availableMigrations), 'New Migrations' => $numNewMigrations];
     return $infos;
 }
开发者ID:itkg-jfranclin,项目名称:migrations,代码行数:22,代码来源:MigrationStatusInfosHelper.php

示例6: markNotMigrated

 public function markNotMigrated()
 {
     $this->configuration->createMigrationTable();
     $this->connection->delete($this->configuration->getMigrationsTableName(), [$this->configuration->getMigrationsColumnName() => $this->version]);
 }
开发者ID:m00t,项目名称:migrations,代码行数:5,代码来源:Version.php


注:本文中的Doctrine\DBAL\Migrations\Configuration\Configuration::getMigrationsColumnName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。