1
0
mirror of synced 2025-01-31 04:21:44 +03:00

enhanced mysql driver foreign key support

This commit is contained in:
zYne 2007-06-13 21:11:36 +00:00
parent a28c399c1c
commit 365bdc23d0

View File

@ -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
*