Commit 2434d95a authored by Guilherme Blanco's avatar Guilherme Blanco

Merge pull request #18 from richardfullmer/master

Support for Postgres SET NULL, SET DEFAULT, and NO ACTION foreign key detection in the PostgresSQLSchema Manager
parents 5d4d1710 208f9956
......@@ -38,10 +38,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$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];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment