Skip to content
Browse files

Added support for the PostgresSqlSchemaManager to correctly parse "SE…

…T NULL", "NO ACTION", and "SET DEFAULT" foreign key update and delete definitions.
  • Loading branch information...
1 parent c330d97 commit 208f995607a544f9606c83d36752a9fd96ed9e64 Richard Fullmer committed Feb 18, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
View
4 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];
}

0 comments on commit 208f995

Please sign in to comment.
Something went wrong with that request. Please try again.