]> git.joonet.de Git - adminer.git/commitdiff
MS SQL: Create primary key for Auto Increment column
authorJakub Vrana <jakub@vrana.cz>
Sun, 28 Nov 2010 16:46:02 +0000 (17:46 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 29 Nov 2010 21:02:11 +0000 (22:02 +0100)
adminer/drivers/mssql.inc.php
todo.txt

index 422ca301b26c6286e326b15a6c55d5481e0cc01f..41b094e06e66c5d62ed4274e8485542278c6eebf 100644 (file)
@@ -396,7 +396,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
        }
 
        function auto_increment() {
-               return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . (+$_POST["Auto_increment"]) . ",1)" : "");
+               return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . (+$_POST["Auto_increment"]) . ",1)" : "") . " PRIMARY KEY";
        }
        
        function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
index 46ad70bc111f3920d2a1ea4a6cc020e19cc9c113..680c84c728d6e8c989ed534fe817f37e62907b12 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -42,6 +42,7 @@ Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
 bool in Editor
 
 MS SQL:
+Display default value
 Non UTF-8 character sets
 Detection of table collation
 PDO_MSSQL and PDO_SQLSRV driver with seek