No column and table deletion in database

Issue #388 invalid
hadia noor created an issue

HI.

I am having trouble in deleting a table’s column and even table itself since yesterday..I am unable to proceed..Please help with that asap.. Thanks

Comments (6)

  1. phpLiteAdmin repo owner

    Please provide more information, like

    • the error message or what happens when you try to delete the column or table.
    • the CREATE table statement of the table and any table that have references (foreign keys) to this table

    Most likely, you cannot delete the column or table because you defined a foreign key constraint form another table to this column. For example, if you have a salary table and an employee table and in the salary table, the employee column is a reference to the id column in the employee table, you cannot delete the id column of the employee table. To solve this, you could remove the foreign key constraint. Afterwards, you can delete the column/table. You may get broken references of course. In the example, you would have salaries that don’t refer to any employee anymore.

  2. hadia noor reporter

    This is the error message

    and this is the table i am trying to delete the column with name “apartment” . This table has no foreign key itself from another table but yes its field ID is used by other tables. So i am not deleting this table residents but just a field named “apartment”

    CREATE TABLE 'residents' ( 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,'username' text NOT NULL ,'hash' TEXT NOT NULL,'apartment' INTEGER NOT NULL )

  3. phpLiteAdmin repo owner

    Can you please enable debug mode (set $debug = true; in your phpliteadmin.config.php or phpliteadmin.php) , try again and post the full output?

  4. phpLiteAdmin repo owner

    And your screenshot indicates that you are using 1.9.7.1. Can you please try 1.9.8.2? We fixed a couple of issues regarding altering tables.

  5. phpLiteAdmin repo owner

    Closed due to missing feedback. Most probably this issue is already fixed in the current version.

  6. Log in to comment