Skip to content

Commit

Permalink
wip: skip empty queries
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Oct 17, 2023
1 parent 3b31219 commit 6b55cc1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Migration/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function checkIntegrity(
$md5 = md5_file($file);

if(is_null($migrationCount)
|| $fileNumber <= $migrationCount) {
|| $fileNumber <= $migrationCount) {
$result = $this->dbClient->executeSql(implode("\n", [
"select `" . self::COLUMN_QUERY_HASH . "`",
"from `{$this->tableName}`",
Expand Down Expand Up @@ -222,6 +222,10 @@ public function performMigration(

try {
foreach($splitSqlQueryList as $sql) {
$sql = trim($sql);
if(!$sql) {
continue;

Check warning on line 227 in src/Migration/Migrator.php

View check run for this annotation

Codecov / codecov/patch

src/Migration/Migrator.php#L227

Added line #L227 was not covered by tests
}
$this->dbClient->executeSql($sql);
}

Expand Down

0 comments on commit 6b55cc1

Please sign in to comment.