query('PRAGMA table_info(' . $matches[1] . ')')->fetchAll(); $columnNames = array_map(static fn (array $column): string => strtolower((string) $column['name']), $columns); if (in_array(strtolower($matches[2]), $columnNames, true)) { continue; } } $db->exec($statement); } fwrite(STDOUT, "Applied: " . basename($migration) . PHP_EOL); }