pgrewrite should not remove IF NOT EXISTS
This commit is contained in:
@@ -39,9 +39,9 @@ class CreateTableSQLRewriter extends AbstractSQLRewriter
|
||||
$sql = $this->original();
|
||||
|
||||
|
||||
$sql = str_replace('CREATE TABLE IF NOT EXISTS ', 'CREATE TABLE ', $sql);
|
||||
$tableSQL = str_replace('CREATE TABLE IF NOT EXISTS ', 'CREATE TABLE ', $sql);
|
||||
$pattern = '/CREATE TABLE [`]?(\w+)[`]?/';
|
||||
preg_match($pattern, $sql, $matches);
|
||||
preg_match($pattern, $tableSQL, $matches);
|
||||
$table = $matches[1];
|
||||
|
||||
// Remove trailing spaces
|
||||
|
||||
Reference in New Issue
Block a user