enhanced mysql driver foreign key support
This commit is contained in:
parent
a28c399c1c
commit
365bdc23d0
@ -569,6 +569,28 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return implode(', ', $declFields);
|
return implode(', ', $declFields);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* getAdvancedForeignKeyOptions
|
||||||
|
* Return the FOREIGN KEY query section dealing with non-standard options
|
||||||
|
* as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
|
||||||
|
*
|
||||||
|
* @param array $definition
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getAdvancedForeignKeyOptions($definition)
|
||||||
|
{
|
||||||
|
$query = '';
|
||||||
|
if (!empty($definition['match'])) {
|
||||||
|
$query .= ' MATCH ' . $definition['match'];
|
||||||
|
}
|
||||||
|
if (!empty($definition['on_update'])) {
|
||||||
|
$query .= ' ON UPDATE ' . $this->getForeignKeyRefentialAction($definition['onUpdate']);
|
||||||
|
}
|
||||||
|
if (!empty($definition['on_delete'])) {
|
||||||
|
$query .= ' ON DELETE ' . $this->getForeignKeyRefentialAction($definition['onDelete']);
|
||||||
|
}
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* drop existing index
|
* drop existing index
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user