mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 18:14:07 +02:00
PostgreSQL: Fix starting value of exported autoincrement
Thanks to @OmlineEditor (https://github.com/adminerevo/adminerevo/issues/113)
This commit is contained in:
@@ -753,8 +753,6 @@ AND typelem = 0"
|
|||||||
}
|
}
|
||||||
|
|
||||||
function create_sql($table, $auto_increment, $style) {
|
function create_sql($table, $auto_increment, $style) {
|
||||||
global $connection;
|
|
||||||
$return = '';
|
|
||||||
$return_parts = array();
|
$return_parts = array();
|
||||||
$sequences = array();
|
$sequences = array();
|
||||||
|
|
||||||
@@ -789,7 +787,10 @@ AND typelem = 0"
|
|||||||
: "SELECT * FROM $sequence_name"
|
: "SELECT * FROM $sequence_name"
|
||||||
));
|
));
|
||||||
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE IF EXISTS $sequence_name;\n" : "")
|
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE IF EXISTS $sequence_name;\n" : "")
|
||||||
. "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value]" . ($auto_increment && $sq['last_value'] ? " START $sq[last_value]" : "") . " CACHE $sq[cache_value];";
|
. "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value]"
|
||||||
|
. ($auto_increment && $sq['last_value'] ? " START " . ($sq["last_value"] + 1) : "")
|
||||||
|
. " CACHE $sq[cache_value];"
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user