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

PostgreSQL: Support CHECK constraint

This commit is contained in:
Jakub Vrana
2025-02-22 21:08:23 +01:00
parent c34c672df9
commit ee9932a0dd
5 changed files with 17 additions and 15 deletions

View File

@@ -4,7 +4,7 @@ $name = $_GET["name"];
$row = $_POST;
if ($row && !$error) {
$result = ($name == "" || queries("ALTER TABLE " . table($TABLE) . " DROP CHECK " . idf_escape($name)));
$result = ($name == "" || queries("ALTER TABLE " . table($TABLE) . " DROP CONSTRAINT " . idf_escape($name)));
if (!$row["drop"] && $result) {
$result = queries("ALTER TABLE " . table($TABLE) . " ADD" . ($row["name"] != "" ? " CONSTRAINT " . idf_escape($row["name"]) . "" : "") . " CHECK ($row[clause])"); //! SQL injection
}