ERROR: UNIQUE constraint failed: users.id

Issue #350 invalid
damian ray dennison created an issue

Comments (4)

  1. phpLiteAdmin repo owner

    Are you creating a new column or a new row? Unique constraint failed means that in your table the values of some column (here id) must be unique. This means when you insert a new row, you need to give a value that does not exist yet in the table. Please give more details

    • how does your table look like (give the CREATE TABLE from the structure tab)
    • What exactly are you trying to create? a row or column?
    • What values are you trying to give?
    • What values do the existing rows of your id column have?
  2. phpLiteAdmin repo owner

    Of course, you also cannot add a new column with a unique constraint to a table that already contains rows, as these rows violate the unique constraint. So you would need to add the new column without the unique constraint, then make the values of the existing rows unique and then add the unique constraint to the new column.

  3. phpLiteAdmin repo owner

    Not enough feedback from the user. Most likely the user doesn't understand what he's doing...

  4. Log in to comment