style fixes
This commit is contained in:
1 parent
021aa6d106
commit
94259e408b
10 files changed
+99
-81
No files matched your search
@@ -58,7 +58,7 @@ class AlterTableSQLRewriter extends AbstractSQLRewriter
|
||||
private function rewriteChangeColumn(string $sql): string
|
||||
{
|
||||
$pattern = '/ALTER TABLE\s+(\w+)\s+CHANGE COLUMN\s+([^\s]+)\s+([^\s]+)\s+([^ ]+)( unsigned|)\s*(NOT NULL|)\s*(default (.+)|)/';
|
||||
|
||||
|
||||
if(1 === preg_match($pattern, $sql, $matches)) {
|
||||
$table = $matches[1];
|
||||
$col = $matches[2];
|
||||
|
||||
@@ -30,7 +30,7 @@ class CreateTableSQLRewriter extends AbstractSQLRewriter
|
||||
// For flash-album-gallery plugin
|
||||
'tinyint' => 'smallint'
|
||||
];
|
||||
|
||||
|
||||
public function rewrite(): string
|
||||
{
|
||||
$sql = $this->original();
|
||||
|
||||
@@ -99,7 +99,7 @@ class InsertSQLRewriter extends AbstractSQLRewriter
|
||||
}
|
||||
|
||||
// Construct the PostgreSQL ON CONFLICT DO UPDATE section
|
||||
$updateSection = implode(', ', array_map(fn($col) => "$col = EXCLUDED.$col", $updateCols));
|
||||
$updateSection = implode(', ', array_map(fn ($col) => "$col = EXCLUDED.$col", $updateCols));
|
||||
|
||||
// Construct the PostgreSQL query
|
||||
$postgresSQL = sprintf('%s %s ON CONFLICT (%s) DO UPDATE SET %s', $tableSection, $valuesSection, $primaryKey, $updateSection);
|
||||
|
||||
Reference in new issue
Block a user