Reverted changes for disabling foreign key sql exporting. Not needed since it can be done with attributes.
This commit is contained in:
parent
684ad68de2
commit
3eedefae50
@ -205,7 +205,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function createTableSql($name, array $fields, array $options = array(), $exportForeignKeySql = true)
|
public function createTableSql($name, array $fields, array $options = array())
|
||||||
{
|
{
|
||||||
if ( ! $name) {
|
if ( ! $name) {
|
||||||
throw new Doctrine_Export_Exception('no valid table name specified');
|
throw new Doctrine_Export_Exception('no valid table name specified');
|
||||||
@ -242,7 +242,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
$sql[] = $query;
|
$sql[] = $query;
|
||||||
|
|
||||||
if (isset($options['foreignKeys']) && $exportForeignKeySql) {
|
if (isset($options['foreignKeys'])) {
|
||||||
|
|
||||||
foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
||||||
if (is_array($definition)) {
|
if (is_array($definition)) {
|
||||||
@ -1047,9 +1047,8 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
$record = new $name();
|
$record = new $name();
|
||||||
$table = $record->getTable();
|
$table = $record->getTable();
|
||||||
$data = $table->getExportableFormat();
|
$data = $table->getExportableFormat();
|
||||||
$exportForeignKeySql = is_bool($table->getOption('export_foreign_key_sql')) ? $table->getOption('export_foreign_key_sql'):true;
|
|
||||||
|
|
||||||
$query = $this->conn->export->createTableSql($data['tableName'], $data['columns'], $data['options'], $exportForeignKeySql);
|
$query = $this->conn->export->createTableSql($data['tableName'], $data['columns'], $data['options']);
|
||||||
|
|
||||||
if (is_array($query)) {
|
if (is_array($query)) {
|
||||||
$sql = array_merge($sql, $query);
|
$sql = array_merge($sql, $query);
|
||||||
|
@ -87,7 +87,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function createTableSql($name, array $fields, array $options = array(), $exportForeignKeySql = true)
|
public function createTableSql($name, array $fields, array $options = array())
|
||||||
{
|
{
|
||||||
if ( ! $name)
|
if ( ! $name)
|
||||||
throw new Doctrine_Export_Exception('no valid table name specified');
|
throw new Doctrine_Export_Exception('no valid table name specified');
|
||||||
@ -169,7 +169,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
$sql[] = $query;
|
$sql[] = $query;
|
||||||
|
|
||||||
if (isset($options['foreignKeys']) && $exportForeignKeySql) {
|
if (isset($options['foreignKeys'])) {
|
||||||
|
|
||||||
foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
||||||
if (is_array($definition)) {
|
if (is_array($definition)) {
|
||||||
|
@ -283,9 +283,9 @@ END;
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function createTableSql($name, array $fields, array $options = array(), $exportForeignKeySql = true)
|
public function createTableSql($name, array $fields, array $options = array())
|
||||||
{
|
{
|
||||||
$sql = parent::createTableSql($name, $fields, $options, $exportForeignKeySql);
|
$sql = parent::createTableSql($name, $fields, $options);
|
||||||
|
|
||||||
foreach ($fields as $fieldName => $field) {
|
foreach ($fields as $fieldName => $field) {
|
||||||
if (isset($field['autoincrement']) && $field['autoincrement'] ||
|
if (isset($field['autoincrement']) && $field['autoincrement'] ||
|
||||||
|
@ -291,7 +291,7 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
|
|||||||
* @param array $options
|
* @param array $options
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
public function createTableSql($name, array $fields, array $options = array(), $exportForeignKeySql = true)
|
public function createTableSql($name, array $fields, array $options = array())
|
||||||
{
|
{
|
||||||
if ( ! $name) {
|
if ( ! $name) {
|
||||||
throw new Doctrine_Export_Exception('no valid table name specified');
|
throw new Doctrine_Export_Exception('no valid table name specified');
|
||||||
@ -318,7 +318,7 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['foreignKeys']) && $exportForeignKeySql) {
|
if (isset($options['foreignKeys'])) {
|
||||||
|
|
||||||
foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
||||||
if (is_array($definition)) {
|
if (is_array($definition)) {
|
||||||
|
@ -155,7 +155,7 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function createTableSql($name, array $fields, array $options = array(), $exportForeignKeySql = true)
|
public function createTableSql($name, array $fields, array $options = array())
|
||||||
{
|
{
|
||||||
if ( ! $name) {
|
if ( ! $name) {
|
||||||
throw new Doctrine_Export_Exception('no valid table name specified');
|
throw new Doctrine_Export_Exception('no valid table name specified');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user