1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 01:54:00 +02:00

MS SQL: Foreign key in create table

This commit is contained in:
Jakub Vrana
2010-11-28 17:39:07 +01:00
parent e86c15479f
commit d7079f1778
2 changed files with 3 additions and 3 deletions

View File

@@ -405,11 +405,11 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
$column = idf_escape($field[0]);
$val = $field[1];
if (!$val) {
$alter["DROP"][] = " COLUMN $field[0]";
$alter["DROP"][] = " COLUMN $column";
} else {
$val[1] = preg_replace("~( COLLATE )'(\\w+)'~", "\\1\\2", $val[1]);
if ($field[0] == "") {
$alter["ADD"][] = "\n " . implode("", $val);
$alter["ADD"][] = "\n " . implode("", $val) . ($table == "" ? substr($foreign[$val[0]], 16 + strlen($val[0])) : ""); // 16 - strlen(" FOREIGN KEY ()")
} else {
unset($val[6]); //! identity can't be removed
if ($column != $val[0]) {