From 208f995607a544f9606c83d36752a9fd96ed9e64 Mon Sep 17 00:00:00 2001 From: Richard Fullmer Date: Fri, 18 Feb 2011 14:49:51 -0500 Subject: [PATCH] Added support for the PostgresSqlSchemaManager to correctly parse "SET NULL", "NO ACTION", and "SET DEFAULT" foreign key update and delete definitions. --- lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index 50e9ba43f7b..5aae59b907e 100644 --- a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -38,10 +38,10 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey) $onUpdate = null; $onDelete = null; - if (preg_match('(ON UPDATE ([a-zA-Z0-9]+))', $tableForeignKey['condef'], $match)) { + if (preg_match('(ON UPDATE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', $tableForeignKey['condef'], $match)) { $onUpdate = $match[1]; } - if (preg_match('(ON DELETE ([a-zA-Z0-9]+))', $tableForeignKey['condef'], $match)) { + if (preg_match('(ON DELETE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', $tableForeignKey['condef'], $match)) { $onDelete = $match[1]; }