Create table with more than one primary key fails

Issue #70 resolved
Christopher Kramer created an issue

Originally reported on Google Code with ID 70 ``` What steps will reproduce the problem? 1. create new table with at least 2 columns 2. check the primary key checkbox for at least 2 columns 3. click "create"

What is the expected output? What do you see instead? Expected: Table created Instead: "Error: table "test" has more than one primary key."

What version of the product are you using? On what operating system? SQLite version: 3.7.7.1 SQLite extension [?]: PDO PHP version: 5.3.8 This is a XAMPP for Windows 1.7.7 installation on Windows 7 Professional 32bit.

Please provide any additional information below. It is possible to create a table with multiple primary keys in SQLite by hand using the following syntax: CREATE TABLE something (column1, column2, PRIMARY KEY (column1, column2));

I ran this command and it worked. So phpliteadmin simply does not use the correct syntax.

```

Reported by `crazy4chrissi` on 2011-11-21 15:34:23

Comments (7)

  1. Former user Account Deleted

    ``` Your "correct" syntax actually creates only ONE key comprised of column1,column2. It's impossible to have more than one primary key in sql. You can create several index however. ```

    Reported by `decoy113101` on 2012-03-09 21:00:47

  2. Christopher Kramer reporter

    ``` Yes, of course I am talking about a compound primary key and not multiple primary keys. Multiple primary keys makes no sense of course, as there is only one primary key for each table per definition. But what I mean is that it should of course be possible to create a compound primary key. It is possible the same way in phpMyAdmin and the sqliteadmin page says that the "user experience is comparable to that of phpMyAdmin". So it should work the same way here as well. ```

    Reported by `crazy4chrissi` on 2012-03-10 10:40:47

  3. Christopher Kramer reporter

    ``` Issue 77 has been merged into this issue. ```

    Reported by `crazy4chrissi` on 2012-05-30 16:04:55

  4. Log in to comment