Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wrap long lines

  • Loading branch information...
commit 7484db1dbf6412cd433d20e08b802e723a697fb5 1 parent b8cc0e1
@ruleant ruleant authored
Showing with 30 additions and 10 deletions.
  1. +30 −10 tbl_relation.php
View
40 tbl_relation.php
@@ -172,7 +172,9 @@
// remove existing key
$sql_query_drop = 'ALTER TABLE ' . PMA_Util::backquote($table)
. ' DROP FOREIGN KEY '
- . PMA_Util::backquote($existrel_foreign[$master_field]['constraint']);
+ . PMA_Util::backquote(
+ $existrel_foreign[$master_field]['constraint']
+ );
$sql_query_drop .= ';';
$display_query .= $sql_query_drop . "\n";
} // end if...
@@ -185,7 +187,9 @@
$sql_query = 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ADD ';
// if user entered a constraint name
if (! empty($_REQUEST['constraint_name'][$master_field_md5])) {
- $sql_query .= ' CONSTRAINT ' . PMA_Util::backquote($_REQUEST['constraint_name'][$master_field_md5]);
+ $sql_query .= ' CONSTRAINT ' . PMA_Util::backquote(
+ $_REQUEST['constraint_name'][$master_field_md5]
+ );
}
$sql_query .= ' FOREIGN KEY ('
. PMA_Util::backquote($master_field) . ')'
@@ -205,7 +209,9 @@
} elseif (isset($existrel_foreign[$master_field])) {
$sql_query = 'ALTER TABLE ' . PMA_Util::backquote($table)
. ' DROP FOREIGN KEY '
- . PMA_Util::backquote($existrel_foreign[$master_field]['constraint']);
+ . PMA_Util::backquote(
+ $existrel_foreign[$master_field]['constraint']
+ );
$sql_query .= ';';
$display_query .= $sql_query . "\n";
} // end if... else....
@@ -244,11 +250,20 @@
// a rollback may be better here
$sql_query_recreate = 'ALTER TABLE ' . PMA_Util::backquote($table)
. ' ADD '
- . ' CONSTRAINT ' . PMA_Util::backquote($existrel_foreign[$master_field]['constraint'])
+ . ' CONSTRAINT ' . PMA_Util::backquote(
+ $existrel_foreign[$master_field]['constraint']
+ )
. ' FOREIGN KEY (' . PMA_Util::backquote($master_field) . ')'
- . ' REFERENCES ' . PMA_Util::backquote($existrel_foreign[$master_field]['foreign_db'])
- . '.' . PMA_Util::backquote($existrel_foreign[$master_field]['foreign_table'])
- . '(' . PMA_Util::backquote($existrel_foreign[$master_field]['foreign_field']) . ')';
+ . ' REFERENCES ' . PMA_Util::backquote(
+ $existrel_foreign[$master_field]['foreign_db']
+ )
+ . '.' . PMA_Util::backquote(
+ $existrel_foreign[$master_field]['foreign_table']
+ )
+ . '(' . PMA_Util::backquote(
+ $existrel_foreign[$master_field]['foreign_field']
+ )
+ . ')';
if (! empty($existrel_foreign[$master_field]['on_delete'])) {
$sql_query_recreate .= ' ON DELETE '
. $existrel_foreign[$master_field]['on_delete'];
@@ -481,9 +496,14 @@
// need to PMA_Util::backquote to support a dot character inside
// an element
$foreign_field = PMA_Util::backquote(
- $existrel_foreign[$myfield]['foreign_db']) . '.'
- . PMA_Util::backquote($existrel_foreign[$myfield]['foreign_table']) . '.'
- . PMA_Util::backquote($existrel_foreign[$myfield]['foreign_field']);
+ $existrel_foreign[$myfield]['foreign_db']
+ )
+ . '.' . PMA_Util::backquote(
+ $existrel_foreign[$myfield]['foreign_table']
+ )
+ . '.' . PMA_Util::backquote(
+ $existrel_foreign[$myfield]['foreign_field']
+ );
} else {
$foreign_field = false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.