createOrUpdateTable() публичный Метод

Generates code for creating or updating a database table.
public createOrUpdateTable ( Doctrine\DBAL\Schema\Table $updatedTable, Doctrine\DBAL\Schema\Table $existingTable, string $newTableName ) : string | boolean
$updatedTable Doctrine\DBAL\Schema\Table Specifies the updated table schema.
$existingTable Doctrine\DBAL\Schema\Table Specifies the existing table schema, if applicable.
$newTableName string An updated name of the theme.
Результат string | boolean Returns the migration up() and down() methods code. Returns false if there the table was not changed.
 public function generateCreateOrUpdateMigration()
 {
     $schemaCreator = new DatabaseTableSchemaCreator();
     $existingSchema = $this->tableInfo;
     $newTableName = $this->name;
     $tableName = $existingSchema ? $existingSchema->getName() : $this->name;
     $newSchema = $schemaCreator->createTableSchema($tableName, $this->columns);
     $codeGenerator = new TableMigrationCodeGenerator();
     $migrationCode = $codeGenerator->createOrUpdateTable($newSchema, $existingSchema, $newTableName);
     if ($migrationCode === false) {
         return $migrationCode;
     }
     $description = $existingSchema ? 'Updated table %s' : 'Created table %s';
     return $this->createMigrationObject($migrationCode, sprintf($description, $tableName));
 }