Skip to content

Commit

Permalink
fix(MigrateDumpCommand::mysqlDump): Preserve boundary and any spacing…
Browse files Browse the repository at this point in the history
… after `AUTO_INCREMENT=...` to avoid corrupting Mysql hints.
  • Loading branch information
Paul Rogers committed Apr 4, 2019
1 parent 0d09b87 commit c1adf39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Commands/MigrateDumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private static function mysqlDump(array $db_config, string $schema_sql_path) : i
if (false === $schema_sql) {
return 1;
}
$schema_sql = preg_replace('/ AUTO_INCREMENT=[0-9]+ ?/iu', '', $schema_sql);
$schema_sql = preg_replace('/(\b)AUTO_INCREMENT=[0-9]+/iu', '\1', $schema_sql);
if (false === file_put_contents($schema_sql_path, $schema_sql)) {
return 1;
}
Expand Down

0 comments on commit c1adf39

Please sign in to comment.