mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 17:44:07 +02:00
Fix ALTER export: add columns together with modify
This commit is contained in:
@@ -582,10 +582,10 @@ CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
|
|||||||
foreach ($fields as $row) {
|
foreach ($fields as $row) {
|
||||||
echo "
|
echo "
|
||||||
WHEN " . q($row["COLUMN_NAME"]) . " THEN
|
WHEN " . q($row["COLUMN_NAME"]) . " THEN
|
||||||
SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', '');
|
SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', IF(
|
||||||
IF NOT (_column_default <=> $row[default]) OR _is_nullable != '$row[IS_NULLABLE]' OR _collation_name != '$row[COLLATION_NAME]' OR _column_type != " . q($row["COLUMN_TYPE"]) . " OR _extra != '$row[EXTRA]' OR _column_comment != " . q($row["COLUMN_COMMENT"]) . " OR after != $row[after] THEN
|
_column_default <=> $row[default] AND _is_nullable = '$row[IS_NULLABLE]' AND _collation_name <=> " . (isset($row["COLLATION_NAME"]) ? "'$row[COLLATION_NAME]'" : "NULL") . " AND _column_type = " . q($row["COLUMN_TYPE"]) . " AND _extra = '$row[EXTRA]' AND _column_comment = " . q($row["COLUMN_COMMENT"]) . " AND after = $row[after]
|
||||||
SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
|
, '', ', MODIFY $row[alter]'));"
|
||||||
END IF;"; //! don't replace in comment
|
; //! don't replace in comment
|
||||||
}
|
}
|
||||||
echo "
|
echo "
|
||||||
ELSE
|
ELSE
|
||||||
|
Reference in New Issue
Block a user