Commit 365bdc23 authored by zYne's avatar zYne

enhanced mysql driver foreign key support

parent a28c399c
......@@ -569,6 +569,28 @@ class Doctrine_Export_Mysql extends Doctrine_Export
}
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
*
......
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