From c1adf39ba520d1c771c7d091c46458ab6eee450b Mon Sep 17 00:00:00 2001 From: Paul Rogers Date: Thu, 4 Apr 2019 17:25:25 -0400 Subject: [PATCH] fix(MigrateDumpCommand::mysqlDump): Preserve boundary and any spacing after `AUTO_INCREMENT=...` to avoid corrupting Mysql hints. --- src/Commands/MigrateDumpCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/MigrateDumpCommand.php b/src/Commands/MigrateDumpCommand.php index 68601f0..1a743be 100644 --- a/src/Commands/MigrateDumpCommand.php +++ b/src/Commands/MigrateDumpCommand.php @@ -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; }