Permalink
Browse files

SQLite doesn't support primary key modification

  • Loading branch information...
1 parent 1e2d497 commit a1bc3cc9cb99737e68013edb02aab58d9e9aa886 @vrana committed Jul 14, 2010
Showing with 6 additions and 1 deletion.
  1. +1 −1 adminer/drivers/sqlite.inc.php
  2. +4 −0 adminer/indexes.inc.php
  3. +1 −0 todo.txt
@@ -429,7 +429,7 @@ function alter_table($table, $name, $fields, $foreign, $comment, $engine, $colla
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;
}
}
View
@@ -6,6 +6,10 @@
$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) {
View
@@ -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

0 comments on commit a1bc3cc

Please sign in to comment.