1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 09:34:10 +02:00

PostgreSQL: Fix starting value of exported autoincrement

Thanks to @OmlineEditor (https://github.com/adminerevo/adminerevo/issues/113)
This commit is contained in:
Peter Knut
2025-01-30 20:48:53 +01:00
committed by Jakub Vrana
parent fdd02a5485
commit e346f47384

View File

@@ -753,8 +753,6 @@ AND typelem = 0"
}
function create_sql($table, $auto_increment, $style) {
global $connection;
$return = '';
$return_parts = array();
$sequences = array();
@@ -789,7 +787,10 @@ AND typelem = 0"
: "SELECT * FROM $sequence_name"
));
$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];"
;
}
}