diff --git a/mixin/lib/civimix-schema/src/SqlGenerator.php b/mixin/lib/civimix-schema/src/SqlGenerator.php index a4ef2f3f2178..64693daf83e0 100644 --- a/mixin/lib/civimix-schema/src/SqlGenerator.php +++ b/mixin/lib/civimix-schema/src/SqlGenerator.php @@ -87,7 +87,7 @@ public function getDropTablesSql(): string { public function generateCreateTableWithConstraintSql(array $entity): string { $definition = $this->getTableDefinition($entity); $constraints = $this->getTableConstraints($entity); - $sql = "CREATE TABLE `{$entity['table']}` (\n " . + $sql = "CREATE TABLE IF NOT EXISTS `{$entity['table']}` (\n " . implode(",\n ", $definition); if ($constraints) { $sql .= ",\n " . implode(",\n ", $constraints);