]> git.joonet.de Git - adminer.git/commitdiff
SQLite doesn't support primary key modification
authorJakub Vrana <jakub@vrana.cz>
Wed, 14 Jul 2010 14:02:50 +0000 (16:02 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 14 Jul 2010 14:02:50 +0000 (16:02 +0200)
adminer/drivers/sqlite.inc.php
adminer/indexes.inc.php
todo.txt

index 170c6f627a62c17b90862a0c6d300421d96ba772..d5af551960de6c480106b8752af3ccd0dbd4f33c 100644 (file)
@@ -429,7 +429,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
        
        function alter_indexes($table, $alter) {
                foreach ($alter as $val) {
-                       if (!queries(($val[2] ? "DROP INDEX" : "CREATE" . ($val[0] != "INDEX" ? " UNIQUE" : "") . " INDEX " . idf_escape(uniqid($table . "_")) . " ON " . table($table)) . " $val[1]")) { //! primary key must be created in CREATE TABLE
+                       if (!queries(($val[2] ? "DROP INDEX" : "CREATE" . ($val[0] != "INDEX" ? " UNIQUE" : "") . " INDEX " . idf_escape(uniqid($table . "_")) . " ON " . table($table)) . " $val[1]")) {
                                return false;
                        }
                }
index 6a4de6afd84c45cb780284e9f5c5518087ea688f..cb9f5c10b8ef233ecd7d18b944783fb59cfe6f96 100644 (file)
@@ -6,6 +6,10 @@ if (ereg("MyISAM|Maria", $table_status["Engine"])) {
        $index_types[] = "FULLTEXT";
 }
 $indexes = indexes($TABLE);
+if ($jush == "sqlite") { // doesn't support primary key
+       unset($index_types[0]);
+       unset($indexes[""]);
+}
 if ($_POST && !$error && !$_POST["add"]) {
        $alter = array();
        foreach ($_POST["indexes"] as $index) {
index 5d68a1de3be985bf292943af9fa65c5a4050f341..96a3d04617c97fff63a3a0a3c9dd802d8f478b9d 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -26,6 +26,7 @@ Saving of MySQL 5 BIT data type - don't use quote()
 ? Geometry support
 
 SQLite:
+ASC and DESC instead of text length in index
 Delimiter in export and SQL command
 Backward keys in Editor